Skip to content

Commit

Permalink
Improve sync status name
Browse files Browse the repository at this point in the history
  • Loading branch information
amberin committed Jun 14, 2024
1 parent 2d84a5b commit 19c606b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,6 @@ public void testBookStatusAfterMultipleSyncsFollowingRemoteFileDeletion() throws
testUtils.sync();
book = dataRepository.getBooks().get(0);
assertNull(book.getLinkRepo());
assertEquals(BookSyncStatus.BOOK_WITHOUT_LINK_AND_PREVIOUS_ERROR.toString(), book.getBook().getSyncStatus());
assertEquals(BookSyncStatus.BOOK_WITH_PREVIOUS_ERROR_AND_NO_LINK.toString(), book.getBook().getSyncStatus());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void updateStatus(int reposCount) {
BookAction lastAction = book.getBook().getLastAction();
if (lastAction != null && lastAction.getType() == BookAction.Type.ERROR) {
// Book is an error state.
status = BookSyncStatus.BOOK_WITHOUT_LINK_AND_PREVIOUS_ERROR;
status = BookSyncStatus.BOOK_WITH_PREVIOUS_ERROR_AND_NO_LINK;
} else {
// Book is not in an error state (automatic linking may be
// attempted).
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/orgzly/android/sync/BookSyncStatus.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum class BookSyncStatus {
BOOK_WITH_LINK_AND_ROOK_EXISTS_BUT_LINK_POINTING_TO_DIFFERENT_ROOK,
ONLY_DUMMY,
ROOK_AND_VROOK_HAVE_DIFFERENT_REPOS,
BOOK_WITHOUT_LINK_AND_PREVIOUS_ERROR,
BOOK_WITH_PREVIOUS_ERROR_AND_NO_LINK,

/* Conflict. */
CONFLICT_BOTH_BOOK_AND_ROOK_MODIFIED,
Expand Down Expand Up @@ -64,7 +64,7 @@ enum class BookSyncStatus {
ROOK_AND_VROOK_HAVE_DIFFERENT_REPOS ->
return "Linked and synced notebooks have different repositories"

BOOK_WITHOUT_LINK_AND_PREVIOUS_ERROR ->
BOOK_WITH_PREVIOUS_ERROR_AND_NO_LINK ->
return context.getString(R.string.sync_status_no_link_and_previous_error)

CONFLICT_BOTH_BOOK_AND_ROOK_MODIFIED ->
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/orgzly/android/sync/SyncUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ object SyncUtils {
BookSyncStatus.CONFLICT_LAST_SYNCED_ROOK_AND_LATEST_ROOK_ARE_DIFFERENT,
BookSyncStatus.ROOK_AND_VROOK_HAVE_DIFFERENT_REPOS,
BookSyncStatus.ONLY_DUMMY,
BookSyncStatus.BOOK_WITHOUT_LINK_AND_PREVIOUS_ERROR ->
BookSyncStatus.BOOK_WITH_PREVIOUS_ERROR_AND_NO_LINK ->
bookAction = BookAction.forNow(BookAction.Type.ERROR, namesake.status.msg())

BookSyncStatus.ROOK_NO_LONGER_EXISTS -> {
Expand Down

0 comments on commit 19c606b

Please sign in to comment.