Skip to content

Commit

Permalink
Update BookNamesake.java
Browse files Browse the repository at this point in the history
  • Loading branch information
amberin authored May 19, 2024
1 parent 89ab6c9 commit a921290
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/src/main/java/com/orgzly/android/sync/BookNamesake.java
Original file line number Diff line number Diff line change
Expand Up @@ -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?
}
}
}
}
Expand Down

0 comments on commit a921290

Please sign in to comment.