mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 03:26:36 +00:00
fix(image-loader): make SSR compatible using a window type check guard
This commit is contained in:
parent
7fdab99812
commit
04056e88c9
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@
|
|||
let image = null;
|
||||
|
||||
$: loading = !loaded && !error;
|
||||
$: if (src) loadImage();
|
||||
$: if (src && typeof window !== "undefined") loadImage();
|
||||
$: if (loaded) dispatch("load");
|
||||
$: if (error) dispatch("error");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue