35 lines
918 B
TypeScript
35 lines
918 B
TypeScript
// Metro module 6019 (f6020).
|
|
import { v4 } from "../../../../_bundle/Module514";
|
|
import { CLIENT_SESSION_STORAGE_VERSION } from "../../../analytics_sessions/SessionUtils";
|
|
let searchSession = null;
|
|
export function getOrCreateQuestHomeSearchSession() {
|
|
let r14;
|
|
const createdAtTimestamp = Date.now();
|
|
if (searchSession == null) {
|
|
const searchSession2 = {
|
|
uuid: v4(),
|
|
createdAtTimestamp,
|
|
lastUsedTimestamp: createdAtTimestamp,
|
|
version: CLIENT_SESSION_STORAGE_VERSION
|
|
};
|
|
searchSession = searchSession2;
|
|
r14 = {
|
|
searchSession: searchSession2,
|
|
isNew: true
|
|
};
|
|
} else {
|
|
searchSession.lastUsedTimestamp = createdAtTimestamp;
|
|
r14 = {
|
|
searchSession,
|
|
isNew: false
|
|
};
|
|
}
|
|
return r14;
|
|
}
|
|
export function clearQuestHomeSearchSession() {
|
|
searchSession = null;
|
|
}
|
|
export function getCurrentQuestHomeSearchSession() {
|
|
return searchSession;
|
|
}
|