We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4c986d commit c97391eCopy full SHA for c97391e
1 file changed
src/clients/localStorage.js
@@ -1,4 +1,5 @@
1
const PROJECT_STORAGE_KEY = 'last-closed-session-project-state';
2
+const GRACE_PERIOD = 5 * 60 * 1000;
3
4
export function dehydrateProject(project) {
5
localStorage.setItem(PROJECT_STORAGE_KEY, JSON.stringify({
@@ -12,7 +13,7 @@ export function rehydrateProject() {
12
13
localStorage.removeItem(PROJECT_STORAGE_KEY);
14
if (dehydrated) {
15
const rehydrated = JSON.parse(dehydrated);
- if (Date.now() - rehydrated.dehydratedAt <= 5 * 60 * 1000) {
16
+ if (Date.now() - rehydrated.dehydratedAt <= GRACE_PERIOD) {
17
return rehydrated.project;
18
}
19
0 commit comments