Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a6dd7ad authored by alperozturk's avatar alperozturk Committed by backportbot[bot]
Browse files

fix

parent 08115c57
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -544,10 +544,15 @@ public class NotesRepository {
    public void toggleFavoriteAndSync(Account account, Note note) {
    public void toggleFavoriteAndSync(Account account, Note note) {
        executor.submit(() -> {
        executor.submit(() -> {
            try {
            try {
                final var noteWithContent = getNoteById(note.getId());
                if (noteWithContent == null) {
                    return;
                }

                final var ssoAccount = AccountImporter.getSingleSignOnAccount(context, account.getAccountName());
                final var ssoAccount = AccountImporter.getSingleSignOnAccount(context, account.getAccountName());
                final var notesAPI = apiProvider.getNotesAPI(context, ssoAccount, getPreferredApiVersion(account.getApiVersion()));
                final var notesAPI = apiProvider.getNotesAPI(context, ssoAccount, getPreferredApiVersion(account.getApiVersion()));
                note.setFavorite(!note.getFavorite());
                noteWithContent.setFavorite(!noteWithContent.getFavorite());
                final var result = notesAPI.updateNote(note);
                final var result = notesAPI.updateNote(noteWithContent);
                final var response = result.execute();
                final var response = result.execute();
                if (response.isSuccessful()) {
                if (response.isSuccessful()) {
                    final var updatedNote = response.body();
                    final var updatedNote = response.body();