- 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
36 lines
651 B
TypeScript
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();
|
|
}
|