fix(react/dialogs): undelete note not working

This commit is contained in:
Elian Doran 2025-08-10 19:19:48 +03:00
parent 238f358d6a
commit d7c4b8f530
No known key found for this signature in database

View File

@ -135,19 +135,17 @@ function DeletedNoteLink({ change, setShown }: { change: RecentChangeRow, setSho
<span className="note-title">{change.current_title}</span> <span className="note-title">{change.current_title}</span>
&nbsp; &nbsp;
(<a href="javascript:" (<a href="javascript:"
onClick={() => { onClick={async () => {
async () => { const text = t("recent_changes.confirm_undelete");
const text = t("recent_changes.confirm_undelete");
if (await dialog.confirm(text)) { if (await dialog.confirm(text)) {
await server.put(`notes/${change.noteId}/undelete`); await server.put(`notes/${change.noteId}/undelete`);
setShown(false); setShown(false);
await ws.waitForMaxKnownEntityChangeId(); await ws.waitForMaxKnownEntityChangeId();
const activeContext = appContext.tabManager.getActiveContext(); const activeContext = appContext.tabManager.getActiveContext();
if (activeContext) { if (activeContext) {
activeContext.setNote(change.noteId); activeContext.setNote(change.noteId);
}
} }
} }
}}> }}>