Skip to content

Commit

Permalink
Don't download sources multiple times when user asks for refresh mult…
Browse files Browse the repository at this point in the history
…iple times in different locations

Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Jan 5, 2024
1 parent d565133 commit ad6ec16
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import static org.openstreetmap.josm.tools.I18n.tr;

import javax.swing.SwingUtilities;

import java.io.IOException;
import java.io.Serial;
import java.time.Instant;
Expand All @@ -22,8 +24,6 @@
import java.util.concurrent.RecursiveTask;
import java.util.concurrent.atomic.AtomicBoolean;

import javax.swing.SwingUtilities;

import org.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo;
import org.openstreetmap.josm.actions.ExpertToggleAction;
import org.openstreetmap.josm.data.Preferences;
Expand Down Expand Up @@ -215,6 +215,7 @@ public void loadDefaults(boolean clearCache, ForkJoinPool worker, boolean fastFa
}
if (listener != null) {
this.finishListenerListenerList.addListener(listener);
return;
}
if (worker == null) {
final var pleaseWaitRunnable = new PleaseWaitRunnable(tr("Update default entries")) {
Expand Down Expand Up @@ -283,7 +284,7 @@ public List<MapWithAIInfo> compute() {
}
// This is literally to avoid allocations on startup
final Preferences preferences;
if (Config.getPref()instanceof Preferences pref) {
if (Config.getPref() instanceof Preferences pref) {
preferences = pref;
} else {
preferences = null;
Expand Down

0 comments on commit ad6ec16

Please sign in to comment.