Skip to content

Commit

Permalink
fix: open last visited budget script
Browse files Browse the repository at this point in the history
Signed-off-by: rare-magma <[email protected]>
  • Loading branch information
rare-magma committed Aug 31, 2024
1 parent b708963 commit b063cd5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 0 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
<link rel="icon" href="/favicon.svg" />
<link rel="apple-touch-icon" href="/favicon.svg" />
<link rel="manifest" href="/manifest.json" />
<script integrity="sha256-rx9EtEVmqxUIzMXrtl4DeG1J3qw+cWA3RniGteNFzho=">
if (window.location.pathname === "/") {
const lastOpenedBudget = localStorage.getItem("guitos_lastOpenedBudget");
if (lastOpenedBudget) {
window.location.pathname = `/${lastOpenedBudget}`
}
}
</script>

<title>guitos</title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion public/_headers
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Referrer-Policy: no-referrer
Permissions-Policy: accelerometer=(), autoplay=(self), camera=(), display-capture=(self), fullscreen=(self), geolocation=(self), gyroscope=(self), magnetometer=(self), microphone=(), payment=(), picture-in-picture=(self), sync-xhr=(), usb=()
Content-Security-Policy: default-src 'self'; img-src https://guitos.app https://www.w3.org data:; frame-ancestors 'none'; script-src 'sha256-rx9EtEVmqxUIzMXrtl4DeG1J3qw+cWA3RniGteNFzho=';
Content-Security-Policy: default-src 'self'; img-src https://guitos.app https://www.w3.org data:; frame-ancestors 'none';

https://guitos.pages.dev/*
X-Robots-Tag: noindex
8 changes: 8 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ const updateSW = registerSW({
}
},
});

if (window.location.pathname === "/") {
const lastOpenedBudget = localStorage.getItem("guitos_lastOpenedBudget");
if (lastOpenedBudget) {
window.location.pathname = `/${lastOpenedBudget}`;
}
}

const rootElement = document.getElementById("root");
const root = rootElement && ReactDOM.createRoot(rootElement);

Expand Down

0 comments on commit b063cd5

Please sign in to comment.