1
0

localstorage

This commit is contained in:
Zef Hemel 2022-05-02 11:32:41 +00:00
parent 2b4d5a0543
commit 092cef08dd

View File

@ -6,7 +6,7 @@ import { HttpSpacePrimitives } from "@silverbulletmd/common/spaces/http_space_pr
safeRun(async () => { safeRun(async () => {
// let localSpace = new Space(new IndexedDBSpacePrimitives("pages"), true); // let localSpace = new Space(new IndexedDBSpacePrimitives("pages"), true);
// localSpace.watch(); // localSpace.watch();
let token: string | undefined = sessionStorage.getItem("token") || undefined; let token: string | undefined = localStorage.getItem("token") || undefined;
let httpPrimitives = new HttpSpacePrimitives("", token); let httpPrimitives = new HttpSpacePrimitives("", token);
while (true) { while (true) {
@ -20,7 +20,7 @@ safeRun(async () => {
alert("Sorry, that's it then"); alert("Sorry, that's it then");
return; return;
} }
sessionStorage.setItem("token", token!); localStorage.setItem("token", token!);
httpPrimitives = new HttpSpacePrimitives("", token); httpPrimitives = new HttpSpacePrimitives("", token);
} }
} }