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

Function readStoredState

codebase/sources/dhtmlxscheduler.js:10346–10374  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

cookieFunction · 0.70

Calls 3

getStorageKeyFunction · 0.70
safeLocalStorageGetFunction · 0.70
parseMethod · 0.65

Tested by

no test coverage detected