fix: check browser env before accessing navigator

This commit is contained in:
JovannMC 2025-04-12 19:34:46 +03:00
parent 2c8cb1922c
commit 4d52e06c9b
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import { browser } from "$app/environment";
import { converters } from "$lib/converters"; import { converters } from "$lib/converters";
import { error, log } from "$lib/logger"; import { error, log } from "$lib/logger";
import { VertFile } from "$lib/types"; import { VertFile } from "$lib/types";
@ -24,7 +25,7 @@ class Files {
); );
private thumbnailQueue = new PQueue({ private thumbnailQueue = new PQueue({
concurrency: navigator.hardwareConcurrency || 4, concurrency: browser ? navigator.hardwareConcurrency || 4 : 4,
}); });
private _addThumbnail = async (file: VertFile) => { private _addThumbnail = async (file: VertFile) => {