2022-10-10 12:50:21 +00:00
|
|
|
import * as clientStore from "../../syscall/silverbullet-syscall/clientStore.ts";
|
|
|
|
import { enableReadOnlyMode } from "../../syscall/silverbullet-syscall/editor.ts";
|
2022-09-16 12:26:47 +00:00
|
|
|
|
|
|
|
export async function editorLoad() {
|
|
|
|
let readOnlyMode = await clientStore.get("readOnlyMode");
|
|
|
|
if (readOnlyMode) {
|
|
|
|
await enableReadOnlyMode(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function toggleReadOnlyMode() {
|
|
|
|
let readOnlyMode = await clientStore.get("readOnlyMode");
|
|
|
|
readOnlyMode = !readOnlyMode;
|
|
|
|
await enableReadOnlyMode(readOnlyMode);
|
|
|
|
await clientStore.set("readOnlyMode", readOnlyMode);
|
|
|
|
}
|