mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
web/remux: check if env is browser before adding listeners
This commit is contained in:
parent
21832005e2
commit
80e32fc0c0
|
@ -1,6 +1,7 @@
|
|||
<script lang="ts">
|
||||
import mime from "mime";
|
||||
import LibAVWrapper from "$lib/libav";
|
||||
import { browser } from "$app/environment";
|
||||
import { beforeNavigate } from '$app/navigation';
|
||||
|
||||
import { openURL } from "$lib/download";
|
||||
|
@ -151,9 +152,9 @@
|
|||
}
|
||||
})
|
||||
|
||||
$: if (processing) {
|
||||
$: if (browser && processing) {
|
||||
window.addEventListener("beforeunload", beforeUnloadHandler);
|
||||
} else {
|
||||
} else if (browser) {
|
||||
window.removeEventListener("beforeunload", beforeUnloadHandler);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue