decord/source/modules/quests/lib/analytics/QuestHomeSearchSession.tsx

35 lines
1.2 KiB
TypeScript
Raw Normal View History

// Module ID: 7836
// Function ID: 7837
// Name: QuestHomeSearchSession
// Dependencies: [1256, 7574, 2]
2026-07-20 16:05:17 +00:00
// Exports: clearQuestHomeSearchSession, getCurrentQuestHomeSearchSession, getOrCreateQuestHomeSearchSession
// Module 7836 (QuestHomeSearchSession)
import v1 from "v1" /* 1256 */;
import SessionUtils from "SessionUtils" /* 7574 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
2026-07-23 10:11:24 +00:00
let c2 = null;
const result = size.fileFinishedImporting("modules/quests/lib/analytics/QuestHomeSearchSession.tsx");
2026-07-20 16:05:17 +00:00
export const getOrCreateQuestHomeSearchSession = function getOrCreateQuestHomeSearchSession() {
const timestamp = Date.now();
if (null == searchSession) {
const obj2 = { searchSession: null, isNew: true };
const obj3 = { uuid: v1.v4(), createdAtTimestamp: timestamp, lastUsedTimestamp: timestamp, version: SessionUtils.CLIENT_SESSION_STORAGE_VERSION };
searchSession = obj3;
obj2.searchSession = obj3;
let obj = obj2;
2026-07-20 16:05:17 +00:00
} else {
searchSession.lastUsedTimestamp = timestamp;
obj = { searchSession, isNew: false };
2026-07-20 16:05:17 +00:00
}
return obj;
};
export function clearQuestHomeSearchSession() {
2026-08-24 06:08:38 +00:00
c2 = null;
2026-07-20 16:05:17 +00:00
}
export function getCurrentQuestHomeSearchSession() {
2026-07-23 10:11:24 +00:00
return c2;
2026-07-20 16:05:17 +00:00
}