MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / readStoredState

Function readStoredState

codebase/sources/dhtmlxscheduler.es.js:10342–10370  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10340 }
10341 }
10342 function readStoredState() {
10343 const storageKey = getStorageKey();
10344 const raw = safeLocalStorageGet(storageKey);
10345 if (!raw) {
10346 return { date: null, mode: null };
10347 }
10348 let parsed;
10349 try {
10350 parsed = JSON.parse(raw);
10351 } catch (e) {
10352 return { date: null, mode: null };
10353 }
10354 if (!parsed || typeof parsed !== "object") {
10355 return { date: null, mode: null };
10356 }
10357 let parsedDate = null;
10358 if (typeof parsed.date === "string" && parsed.date.length > 0) {
10359 try {
10360 parsedDate = stringToDate(parsed.date);
10361 if (isNaN(+parsedDate)) {
10362 parsedDate = null;
10363 }
10364 } catch (e) {
10365 parsedDate = null;
10366 }
10367 }
10368 const parsedMode = typeof parsed.mode === "string" ? parsed.mode : null;
10369 return { date: parsedDate, mode: parsedMode };
10370 }
10371 function urlHasExplicitNavigation() {
10372 if (!scheduler2._get_url_nav) {
10373 return false;

Callers 1

cookieFunction · 0.70

Calls 3

getStorageKeyFunction · 0.70
safeLocalStorageGetFunction · 0.70
parseMethod · 0.65

Tested by

no test coverage detected