From 4d52e06c9bc621bb8a5024e992cb8f91de2bc02e Mon Sep 17 00:00:00 2001 From: JovannMC Date: Sat, 12 Apr 2025 19:34:46 +0300 Subject: [PATCH] fix: check browser env before accessing navigator --- src/lib/store/index.svelte.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/store/index.svelte.ts b/src/lib/store/index.svelte.ts index 20fddd8..86536d0 100644 --- a/src/lib/store/index.svelte.ts +++ b/src/lib/store/index.svelte.ts @@ -1,3 +1,4 @@ +import { browser } from "$app/environment"; import { converters } from "$lib/converters"; import { error, log } from "$lib/logger"; import { VertFile } from "$lib/types"; @@ -24,7 +25,7 @@ class Files { ); private thumbnailQueue = new PQueue({ - concurrency: navigator.hardwareConcurrency || 4, + concurrency: browser ? navigator.hardwareConcurrency || 4 : 4, }); private _addThumbnail = async (file: VertFile) => {