Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions apps/client/src/pages/timelapse/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,29 @@ export default function Page() {
function handleStreamInterrupt() {

}
const didRun = useRef(false);
// force this code to be ran on the client
useEffect(() => {
let release = {};
if (didRun.current) { return; }
didRun.current = true;

navigator.locks.request("lapse_lock_thing", { ifAvailable: true },
async (lock) => {
if (!lock) {
console.log("didn't get tab lock...")
console.log(lock)
alert("You can only have one tab open on the recording page. Close the other tab.")
router.push("/")
return
}
console.log("got tab lock. I think")
console.log(lock)
await new Promise((resolve) => {
release = resolve
})
})
}, [])

return (
<RootLayout showHeader={false}>
Expand Down
Loading