15 lines
472 B
TypeScript
15 lines
472 B
TypeScript
const STORAGE_PREFIX = "routerlists:release-modal:"
|
|
|
|
export function getReleaseModalStorageKey(tag: string): string {
|
|
return `${STORAGE_PREFIX}${tag}`
|
|
}
|
|
|
|
export function hasSeenReleaseModal(tag: string): boolean {
|
|
if (typeof window === "undefined") return true
|
|
return window.localStorage.getItem(getReleaseModalStorageKey(tag)) === "1"
|
|
}
|
|
|
|
export function markReleaseModalSeen(tag: string): void {
|
|
window.localStorage.setItem(getReleaseModalStorageKey(tag), "1")
|
|
}
|