feat: default to delete permanently option for errored note

This commit is contained in:
Mo Bitar
2021-10-26 10:21:23 -05:00
parent 82fc103a3e
commit dbb2598f81

View File

@@ -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);
@@ -225,6 +226,19 @@ export const NotesOptions = observer(
});
};
if (errored) {
return (
<>
<DeletePermanentlyButton
closeOnBlur={closeOnBlur}
onClick={async () => {
await appState.notes.deleteNotesPermanently();
}}
/>
</>
);
}
return (
<>
<Switch