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