Skip to content

Commit

Permalink
feat: default to delete permanently option for errored note
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Oct 26, 2021
1 parent 82fc103 commit dbb2598
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/assets/javascripts/components/NotesOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export const NotesOptions = observer(
const notTrashed = notes.some((note) => !note.trashed);
const pinned = notes.some((note) => note.pinned);
const unpinned = notes.some((note) => !note.pinned);
const errored = notes.some((note) => note.errorDecrypting);

const tagsButtonRef = useRef<HTMLButtonElement>(null);

Expand Down Expand Up @@ -225,6 +226,19 @@ export const NotesOptions = observer(
});
};

if (errored) {
return (
<>
<DeletePermanentlyButton
closeOnBlur={closeOnBlur}
onClick={async () => {
await appState.notes.deleteNotesPermanently();
}}
/>
</>
);
}

return (
<>
<Switch
Expand Down

0 comments on commit dbb2598

Please sign in to comment.