From 69f11514a7e8fcb3ae18266309dd5beaf1c37eed Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Mon, 17 Sep 2018 18:14:12 +0300 Subject: [PATCH] Fix #5842 --- .../plus/wikivoyage/explore/ExploreTabFragment.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java index 4559c44f28..7ab7166b8c 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/ExploreTabFragment.java @@ -233,11 +233,12 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv final DownloadIndexesThread downloadThread = app.getDownloadThread(); boolean outdated = mainIndexItem != null && mainIndexItem.isOutdated(); + boolean needsDownloading = mainIndexItem != null && !mainIndexItem.isDownloaded(); File selectedTravelBook = app.getTravelDbHelper().getSelectedTravelBook(); - if (selectedTravelBook == null || (outdated && app.getSettings().SHOW_TRAVEL_UPDATE_CARD.get())) { + if (selectedTravelBook == null || needsDownloading || (outdated && app.getSettings().SHOW_TRAVEL_UPDATE_CARD.get())) { boolean showOtherMaps = false; - if (selectedTravelBook == null) { + if (needsDownloading) { List items = downloadThread.getIndexes().getWikivoyageItems(); showOtherMaps = items != null && items.size() > 1; } @@ -341,9 +342,10 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadEv @NonNull private String getWikivoyageFileName() { - OsmandApplication app = getMyApplication(); - File selectedTravelBook = app != null ? app.getTravelDbHelper().getSelectedTravelBook() : null; - return selectedTravelBook == null ? WORLD_WIKIVOYAGE_FILE_NAME : selectedTravelBook.getName(); +// OsmandApplication app = getMyApplication(); +// File selectedTravelBook = app != null ? app.getTravelDbHelper().getSelectedTravelBook() : null; +// return selectedTravelBook == null ? WORLD_WIKIVOYAGE_FILE_NAME : selectedTravelBook.getName(); + return WORLD_WIKIVOYAGE_FILE_NAME; } private void removeDownloadUpdateCard() {