From 99d4ca5b378f6b361e836f97be79e3d08809158c Mon Sep 17 00:00:00 2001 From: skarab42 Date: Wed, 3 Feb 2021 15:00:13 +0100 Subject: [PATCH 1/2] fix: Add missing file exists notification --- .../Anime/Timeline/Editor/InsertTextModal.svelte | 7 +++++++ .../components/Anime/Timeline/Editor/Timeline.svelte | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/front-src/client/components/Anime/Timeline/Editor/InsertTextModal.svelte b/front-src/client/components/Anime/Timeline/Editor/InsertTextModal.svelte index af3a3fe8..93482359 100644 --- a/front-src/client/components/Anime/Timeline/Editor/InsertTextModal.svelte +++ b/front-src/client/components/Anime/Timeline/Editor/InsertTextModal.svelte @@ -4,6 +4,10 @@ import Modal from "@/components/UI/Modal.svelte"; import Input from "@/components/UI/Input.svelte"; import Button from "@/components/UI/Button.svelte"; + import Notify from "@/components/UI/Notify.svelte"; + + export let notify = null; + const dispatch = createEventDispatcher(); @@ -24,6 +28,9 @@ + {#if notify} + + {/if}
diff --git a/front-src/client/components/Anime/Timeline/Editor/Timeline.svelte b/front-src/client/components/Anime/Timeline/Editor/Timeline.svelte index 6710d94e..3a5df133 100644 --- a/front-src/client/components/Anime/Timeline/Editor/Timeline.svelte +++ b/front-src/client/components/Anime/Timeline/Editor/Timeline.svelte @@ -21,6 +21,7 @@ let fileManager = false; let insetTextModal = false; + let fileManagerNotify = null; let splitter = { x: 200, width: 4, min: 100, max: 500 }; const accept = ["image", "audio", "text", "video", "font"]; @@ -56,12 +57,10 @@ .upload({ name, buffer }) .then((uplodedFile) => { dispatch("file", uplodedFile); + closeInsertTextModal(); }) .catch((error) => { - console.log("ERROR >>>", error); - }) - .then(() => { - closeInsertTextModal(); + fileManagerNotify = { type: "error", message: error }; }); } @@ -115,6 +114,7 @@ /> Date: Wed, 3 Feb 2021 15:49:10 +0100 Subject: [PATCH 2/2] fix: Tags list update !!! Remove inset tag on click --- .../Timeline/Editor/Timeline/TagList.svelte | 19 ++++++++++++++ .../Editor/Timeline/TextEditorModal.svelte | 26 ++----------------- .../Widgets/Anime/Timeline/Settings.svelte | 5 ++-- 3 files changed, 24 insertions(+), 26 deletions(-) create mode 100644 front-src/client/components/Anime/Timeline/Editor/Timeline/TagList.svelte diff --git a/front-src/client/components/Anime/Timeline/Editor/Timeline/TagList.svelte b/front-src/client/components/Anime/Timeline/Editor/Timeline/TagList.svelte new file mode 100644 index 00000000..24e775da --- /dev/null +++ b/front-src/client/components/Anime/Timeline/Editor/Timeline/TagList.svelte @@ -0,0 +1,19 @@ + + +
+ {#each tags as tag} +
${tag}
+ {/each} +
diff --git a/front-src/client/components/Anime/Timeline/Editor/Timeline/TextEditorModal.svelte b/front-src/client/components/Anime/Timeline/Editor/Timeline/TextEditorModal.svelte index c45e283e..8eda11a6 100644 --- a/front-src/client/components/Anime/Timeline/Editor/Timeline/TextEditorModal.svelte +++ b/front-src/client/components/Anime/Timeline/Editor/Timeline/TextEditorModal.svelte @@ -1,6 +1,6 @@ -
- {#each tags as tag} -
- ${tag} -
- {/each} -
+
{#await fetchText(item.target.filename)} Loading.... diff --git a/front-src/client/components/Widgets/Anime/Timeline/Settings.svelte b/front-src/client/components/Widgets/Anime/Timeline/Settings.svelte index a8686b83..0c3dcdb6 100644 --- a/front-src/client/components/Widgets/Anime/Timeline/Settings.svelte +++ b/front-src/client/components/Widgets/Anime/Timeline/Settings.svelte @@ -9,11 +9,12 @@ export let data; + let widget = null; let initialItems = []; - let widget = data.widget; let timelineOpened = false; - fetchItems(); + $: widget = data.widget; + $: widget && fetchItems(); function fetchItems() { actionsAPI.get(widget.id).then(({ items } = {}) => {