Skip to content

Commit

Permalink
@uppy/svelte: do not attempt removing plugin before it's created (#5186)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored May 22, 2024
1 parent c0142f6 commit e6efc0e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/@uppy/svelte/src/components/Dashboard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
plugin = uppy.getPlugin(options.id) as DashboardPlugin;
}
const uninstallPlugin = (uppyInstance: Uppy = uppy) => {
uppyInstance.removePlugin(plugin);
if (plugin != null) uppyInstance.removePlugin(plugin);
}
onMount(() => installPlugin())
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/svelte/src/components/DashboardModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
if(open) plugin.openModal();
}
const uninstallPlugin = (uppyInstance: Uppy = uppy) => {
uppyInstance.removePlugin(plugin);
if (plugin != null) uppyInstance.removePlugin(plugin);
}
onMount(() => installPlugin())
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/svelte/src/components/DragDrop.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
plugin = uppy.getPlugin(options.id) as DragDropPlugin;
}
const uninstallPlugin = (uppyInstance: Uppy = uppy) => {
uppyInstance.removePlugin(plugin);
if (plugin != null) uppyInstance.removePlugin(plugin);
}
onMount(() => installPlugin())
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/svelte/src/components/ProgressBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
plugin = uppy.getPlugin(options.id) as ProgressBarPlugin;
}
const uninstallPlugin = (uppyInstance: Uppy = uppy) => {
uppyInstance.removePlugin(plugin);
if (plugin != null) uppyInstance.removePlugin(plugin);
}
onMount(() => installPlugin())
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/svelte/src/components/StatusBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
plugin = uppy.getPlugin(options.id) as StatusBarPlugin;
}
const uninstallPlugin = (uppyInstance: Uppy = uppy) => {
uppyInstance.removePlugin(plugin);
if (plugin != null) uppyInstance.removePlugin(plugin);
}
onMount(() => installPlugin())
Expand Down

0 comments on commit e6efc0e

Please sign in to comment.