v0.2.84
This commit is contained in:
1 parent
6329ac33d1
commit
90e3c399ea
22 files changed
+729
-46
No files matched your search
@@ -112,18 +112,22 @@ export function createWorkspaceNoteAdapter() {
|
||||
: "Delete note";
|
||||
},
|
||||
async deleteNote(info, accessToken) {
|
||||
if (!await askConfirm(`Delete note “${info.title}”? This cannot be undone.`, {
|
||||
const archive = Boolean(info.archive_deleted_notes);
|
||||
const message = archive
|
||||
? `Delete note “${info.title}”? It will be archived and hidden from this workspace, but kept in the database.`
|
||||
: `Delete note “${info.title}”? This cannot be undone.`;
|
||||
if (!await askConfirm(message, {
|
||||
title: "Delete note",
|
||||
confirmText: "Delete",
|
||||
confirmText: archive ? "Archive" : "Delete",
|
||||
danger: true,
|
||||
})) return;
|
||||
await api(base, {
|
||||
const result = await api(base, {
|
||||
method: "DELETE",
|
||||
body: JSON.stringify({ access_token: accessToken || null }),
|
||||
});
|
||||
queueToast(`The note "${info.title}" was deleted.`, {
|
||||
queueToast(result.archived ? `The note "${info.title}" was archived.` : `The note "${info.title}" was deleted.`, {
|
||||
type: "success",
|
||||
title: "Note deleted",
|
||||
title: result.archived ? "Note archived" : "Note deleted",
|
||||
});
|
||||
location.assign(`/w/${encode(workspaceSlug)}`);
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user