From a8219611cbebbd27501d9f30c804979048b98107 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Tue, 13 Dec 2022 14:48:11 +0100 Subject: feat: A whole slew of things - Use a md5 hash of the session cookie value as key for session validity check - Introduce global state - Introduce a common interface for form logic, and implement it on the sign-in form - Introduce static resolve() on all services instead of new-upping all over. - Implement /portal on the frontend to support giving the frontend a inital context from server or anywhere. - Show a notification when users sign in for the first time after validating their email --- code/app/src/help/persistent-store.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'code/app/src/help/persistent-store.ts') diff --git a/code/app/src/help/persistent-store.ts b/code/app/src/help/persistent-store.ts index 6a54282..cb12547 100644 --- a/code/app/src/help/persistent-store.ts +++ b/code/app/src/help/persistent-store.ts @@ -1,6 +1,7 @@ import {browser} from "$app/environment"; import {writable as _writable, readable as _readable} from "svelte/store"; import type {Writable, Readable, StartStopNotifier} from "svelte/store"; +import { log_debug, log_info } from "./logger"; enum StoreType { SESSION = 0, @@ -76,11 +77,11 @@ function subscribe(store: Writable | Readable, options: WritableStore(options: WritableStore): Writable { if (!browser) { - console.warn("Persistent store is only available in the browser"); + log_info("WARN: Persistent store is only available in the browser"); return; } if (options.options === undefined) options.options = default_store_options; - console.log("Creating writable store with options: ", options); + log_debug("creating writable store with options: ", options); const store = _writable(options.initialState); hydrate(store, options); subscribe(store, options); @@ -89,11 +90,11 @@ function writable_persistent(options: WritableStore): Writable { function readable_persistent(options: ReadableStore): Readable { if (!browser) { - console.warn("Persistent store is only available in the browser"); + log_info("WARN: Persistent store is only available in the browser"); return; } if (options.options === undefined) options.options = default_store_options; - console.log("Creating readable store with options: ", options); + log_debug("Creating readable store with options: ", options); const store = _readable(options.initialState, options.callback); // hydrate(store, options); subscribe(store, options); -- cgit v1.3