Skip to content

Build your personal knowledge base with Trilium Notes

fix(react/dialogs): undelete note not working

Elian Dorand7c4b8f530d0
diff --git a/apps/client/src/widgets/dialogs/recent_changes.tsx b/apps/client/src/widgets/dialogs/recent_changes.tsx
index 0bf3b08fef..90dc99f544 100644
--- a/apps/client/src/widgets/dialogs/recent_changes.tsx
+++ b/apps/client/src/widgets/dialogs/recent_changes.tsx
@@ -135,19 +135,17 @@ function DeletedNoteLink({ change, setShown }: { change: RecentChangeRow, setSho
<span className="note-title">{change.current_title}</span>
&nbsp;
(<a href="javascript:"
- onClick={() => {
- async () => {
- const text = t("recent_changes.confirm_undelete");
-
- if (await dialog.confirm(text)) {
- await server.put(`notes/${change.noteId}/undelete`);
- setShown(false);
- await ws.waitForMaxKnownEntityChangeId();
-
- const activeContext = appContext.tabManager.getActiveContext();
- if (activeContext) {
- activeContext.setNote(change.noteId);
- }
+ onClick={async () => {
+ const text = t("recent_changes.confirm_undelete");
+
+ if (await dialog.confirm(text)) {
+ await server.put(`notes/${change.noteId}/undelete`);
+ setShown(false);
+ await ws.waitForMaxKnownEntityChangeId();
+
+ const activeContext = appContext.tabManager.getActiveContext();
+ if (activeContext) {
+ activeContext.setNote(change.noteId);
}
}
}}>