small fix
This commit is contained in:
parent
7223ea0757
commit
15d054f090
@ -1,7 +1,7 @@
|
||||
import { decodeKeyVault, deriveKeyVault, encodeKeyVault, type KeyVault } from "./crypto";
|
||||
|
||||
export function loggedIn() {
|
||||
if (typeof window === 'undefined') return false;
|
||||
if (typeof window !== 'object') return false;
|
||||
return !!sessionStorage['_vault'];
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
let videoSrc = $state<string | null>(null);
|
||||
|
||||
onMount(() => {
|
||||
if (!window) return;
|
||||
if (typeof window !== 'object') return;
|
||||
|
||||
if (!loggedIn()) {
|
||||
window.location.href = '/login';
|
||||
|
@ -12,7 +12,7 @@
|
||||
};
|
||||
|
||||
onMount(() => {
|
||||
if (!window) return;
|
||||
if (typeof window !== 'object') return;
|
||||
|
||||
if (loggedIn()) {
|
||||
window.location.href = '/today';
|
||||
|
@ -3,7 +3,7 @@
|
||||
import { onMount } from "svelte";
|
||||
|
||||
onMount(() => {
|
||||
if (!window) return;
|
||||
if (typeof window !== 'object') return;
|
||||
|
||||
if (!loggedIn()) {
|
||||
window.location.href = '/login';
|
||||
|
@ -18,7 +18,7 @@
|
||||
let recorder: MediaRecorder | null = null;
|
||||
|
||||
onMount(() => {
|
||||
if (!window) return;
|
||||
if (typeof window !== 'object') return;
|
||||
|
||||
if (!loggedIn()) {
|
||||
window.location.href = '/login';
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
|
||||
onMount(() => {
|
||||
if (!window) return;
|
||||
if (typeof window !== 'object') return;
|
||||
|
||||
const interval = setInterval(() => {
|
||||
now = new Date();
|
||||
@ -37,7 +37,9 @@
|
||||
});
|
||||
|
||||
onMount(async () => {
|
||||
if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
|
||||
if (typeof window !== 'object') return;
|
||||
|
||||
if (!navigator || !navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
import { onMount } from "svelte";
|
||||
|
||||
onMount(() => {
|
||||
if (!window) return;
|
||||
if (typeof window !== 'object') return;
|
||||
|
||||
console.log('test', loggedIn());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user