Skip to content

Commit acb5216

Browse files
alperozturk96AndyScherzinger
authored andcommitted
check db status
Signed-off-by: alperozturk <[email protected]>
1 parent c8c74fd commit acb5216

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesRepository.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -546,16 +546,8 @@ public void toggleFavoriteAndSync(Account account, Note note) {
546546
try {
547547
final var ssoAccount = AccountImporter.getSingleSignOnAccount(context, account.getAccountName());
548548
final var notesAPI = apiProvider.getNotesAPI(context, ssoAccount, getPreferredApiVersion(account.getApiVersion()));
549-
550-
boolean newFavoriteValue = !note.getFavorite();
551-
DBStatus newDBStatus = DBStatus.VOID;
552-
553-
if (newFavoriteValue) {
554-
newDBStatus = DBStatus.LOCAL_EDITED;
555-
}
556-
557-
note.setFavorite(newFavoriteValue);
558-
note.setStatus(newDBStatus);
549+
note.setFavorite(!note.getFavorite());
550+
note.setStatus(DBStatus.LOCAL_EDITED);
559551
final var result = notesAPI.updateNote(note);
560552
final var response = result.execute();
561553
if (response.isSuccessful()) {

0 commit comments

Comments
 (0)