From 3635f85cab7d3314ceffb2e0381a50801c7504a5 Mon Sep 17 00:00:00 2001 From: Jake Ginnivan Date: Sat, 1 Aug 2020 18:30:17 +0800 Subject: [PATCH 1/2] Show more descriptive toast --- src/index.html | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/index.html b/src/index.html index 59f4e41..78c8141 100644 --- a/src/index.html +++ b/src/index.html @@ -243,7 +243,7 @@ `.svg`" x-bind:download="downloadType === 'download-svg' && item.icon_name" class="flex flex-col relative items-center group justify-center text-gray-700 rounded shadow hover:shadow-xl bg-white cursor-pointer transition duration-150 ease-in-out h-32 md:h-40" - @click="handleClick(item, downloadType, $event), $dispatch('show:toast', item.icon_name), setTimeout(() => $dispatch('show:toast', false), 1000)" + @click="handleClick(item, downloadType, $event, $dispatch)" >
- Copied + + +
$dispatch('show:toast', false), 1000) }); } }); @@ -1449,6 +1453,12 @@ item.icon_path + `.svg`; navigator.clipboard.writeText(url); + + $dispatch('show:toast', item.icon_name) + setTimeout(() => $dispatch('show:toast', false), 1000) + } else { + $dispatch('show:toast', item.icon_name) + setTimeout(() => $dispatch('show:toast', false), 1000) } }, }; From 15f2ceead4b1066f6e73051b70e163a5cd18f190 Mon Sep 17 00:00:00 2001 From: Corey Date: Sat, 1 Aug 2020 18:34:12 +0800 Subject: [PATCH 2/2] Fixed broken attribute bug --- src/index.html | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/index.html b/src/index.html index 78c8141..1266664 100644 --- a/src/index.html +++ b/src/index.html @@ -260,9 +260,15 @@ x-transition:leave-start="opacity-100 transform scale-100" x-transition:leave-end="opacity-0 transform scale-90" > - - - + + + $dispatch('show:toast', false), 1000) + $dispatch("show:toast", item.icon_name); + setTimeout(() => $dispatch("show:toast", false), 1000); }); } }); @@ -1453,12 +1459,12 @@ item.icon_path + `.svg`; navigator.clipboard.writeText(url); - - $dispatch('show:toast', item.icon_name) - setTimeout(() => $dispatch('show:toast', false), 1000) + + $dispatch("show:toast", item.icon_name); + setTimeout(() => $dispatch("show:toast", false), 1000); } else { - $dispatch('show:toast', item.icon_name) - setTimeout(() => $dispatch('show:toast', false), 1000) + $dispatch("show:toast", item.icon_name); + setTimeout(() => $dispatch("show:toast", false), 1000); } }, };