From 1f7dc694dd09237d1d099da818ad01a20db2e07f Mon Sep 17 00:00:00 2001 From: Victor Andreasson Date: Sat, 18 May 2024 21:47:30 +0200 Subject: [PATCH] Update BookNamesake.java --- .../com/orgzly/android/sync/BookNamesake.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/orgzly/android/sync/BookNamesake.java b/app/src/main/java/com/orgzly/android/sync/BookNamesake.java index c20da5b25..609c74b9c 100644 --- a/app/src/main/java/com/orgzly/android/sync/BookNamesake.java +++ b/app/src/main/java/com/orgzly/android/sync/BookNamesake.java @@ -149,14 +149,19 @@ public void updateStatus(int reposCount) { status = BookSyncStatus.ONLY_BOOK_WITH_LINK; } } else { /* Only local book without link. */ - if (reposCount > 1) { - status = BookSyncStatus.ONLY_BOOK_WITHOUT_LINK_AND_MULTIPLE_REPOS; + if (book.hasSync()) { + // Book has been synced previously, but lost its link. + status = BookSyncStatus.SYNCED_BOOK_WITHOUT_LINK; } else { - status = BookSyncStatus.ONLY_BOOK_WITHOUT_LINK_AND_ONE_REPO; - } // TODO: What about no repos? + // Book has never been synced. + if (reposCount > 1) { + status = BookSyncStatus.ONLY_BOOK_WITHOUT_LINK_AND_MULTIPLE_REPOS; + } else { + status = BookSyncStatus.ONLY_BOOK_WITHOUT_LINK_AND_ONE_REPO; + } // TODO: What about no repos? + } } } - return; }