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 17e1c65d5..0d5babecf 100644 --- a/app/src/main/java/com/orgzly/android/sync/BookNamesake.java +++ b/app/src/main/java/com/orgzly/android/sync/BookNamesake.java @@ -143,24 +143,24 @@ public void updateStatus(int reposCount) { } else { if (book.hasLink()) { /* Only local book with a link. */ if (book.hasSync()) { - // Book has been synced with a remote book which no longer exists. + // Book was previously synced with a remote book which no longer exists. status = BookSyncStatus.ROOK_NO_LONGER_EXISTS; } else { // Book is linked to a repo, but not yet synced. status = BookSyncStatus.ONLY_BOOK_WITH_LINK; } } else { /* Only local book without link. */ - BookAction lastAction = book.getBook().getLastAction(); - if (lastAction != null && lastAction.getType() == BookAction.Type.ERROR) { - // Book has previously had trouble syncing. - status = BookSyncStatus.BOOK_WITHOUT_LINK_AND_PREVIOUS_ERROR; - } else { - // No previous error; book has most likely never been synced before. - if (reposCount > 1) { - status = BookSyncStatus.BOOK_NEVER_SYNCED_WITHOUT_LINK_AND_MULTIPLE_REPOS; + if (reposCount > 1) { + status = BookSyncStatus.BOOK_NEVER_SYNCED_WITHOUT_LINK_AND_MULTIPLE_REPOS; + } else { // Only one repository configured + BookAction lastAction = book.getBook().getLastAction(); + if (lastAction != null && lastAction.getType() == BookAction.Type.ERROR) { + // Book has previously had trouble syncing. + status = BookSyncStatus.BOOK_WITHOUT_LINK_AND_PREVIOUS_ERROR; } else { + // Book has probably never been synced (automatic linking may be attempted). status = BookSyncStatus.BOOK_NEVER_SYNCED_WITHOUT_LINK_AND_ONE_REPO; - } // TODO: What about no repos? + } } } }