-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Resume Page Focus Now Checks Session State (#961)
- Loading branch information
1 parent
9f85f6c
commit e48af6b
Showing
8 changed files
with
94 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
export class LocalMemory { | ||
constructor (initialState = {}) { | ||
this.state = initialState | ||
} | ||
|
||
get (key) { | ||
try { | ||
return this.state[key] | ||
} catch (err) { | ||
// Error is ignored | ||
return '' | ||
} | ||
} | ||
|
||
set (key, value) { | ||
try { | ||
if (value === undefined || value === null) return this.remove(key) | ||
this.state[key] = value | ||
} catch (err) { | ||
// Error is ignored | ||
} | ||
} | ||
|
||
remove (key) { | ||
try { | ||
delete this.state[key] | ||
} catch (err) { | ||
// Error is ignored | ||
} | ||
} | ||
} | ||
export const model = { | ||
value: '', | ||
inactiveAt: 0, | ||
expiresAt: 0, | ||
updatedAt: Date.now(), | ||
sessionReplayMode: 0, | ||
sessionReplaySentFirstChunk: false, | ||
sessionTraceMode: 0, | ||
traceHarvestStarted: false, | ||
custom: {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters