Files
plainleaf/plugs/editor/system.ts
T
Zef Hemel 1703020a8a feat: Add logout option to client wipe functionality
- Add optional logout parameter to system.wipeClient

- Add new 'Clear Local Storage & Logout' command

- Update API to support logout parameter

- Clean up server code comments
2025-03-28 13:45:39 +01:00

36 lines
651 B
TypeScript

import {
editor,
markdown,
system,
} from "@silverbulletmd/silverbullet/syscalls";
export async function parsePageCommand() {
console.log(
"AST",
JSON.stringify(
await markdown.parseMarkdown(await editor.getText()),
null,
2,
),
);
}
export async function wipeClientCommand() {
if (
!await editor.confirm(
"Are you sure you want to wipe the client? This will clean the local cache.",
)
) {
return;
}
await system.wipeClient();
}
export async function wipeAndLogoutCommand() {
await system.wipeClient(true);
}
export async function reloadUICommand() {
await editor.reloadUI();
}