diff options
Diffstat (limited to 'src/site/components')
| -rw-r--r-- | src/site/components/grid/Grid.vue | 18 | ||||
| -rw-r--r-- | src/site/components/uploader/Uploader.vue | 20 |
2 files changed, 17 insertions, 21 deletions
diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue index eaeb4f7..89ac125 100644 --- a/src/site/components/grid/Grid.vue +++ b/src/site/components/grid/Grid.vue @@ -191,17 +191,13 @@ export default { type: 'is-danger', hasIcon: true, onConfirm: async () => { - try { - const response = await this.$axios.$delete(`file/${file.id}`); - this.showWaterfall = false; - this.files.splice(index, 1); - this.$nextTick(() => { - this.showWaterfall = true; - }); - return this.$toast.open(response.message); - } catch (error) { - return this.$onPromiseError(error); - } + const response = await this.$axios.$delete(`file/${file.id}`); + this.showWaterfall = false; + this.files.splice(index, 1); + this.$nextTick(() => { + this.showWaterfall = true; + }); + return this.$toast.open(response.message); } }); } diff --git a/src/site/components/uploader/Uploader.vue b/src/site/components/uploader/Uploader.vue index d81df56..6a4da8b 100644 --- a/src/site/components/uploader/Uploader.vue +++ b/src/site/components/uploader/Uploader.vue @@ -134,13 +134,9 @@ export default { Get all available albums so the user can upload directly to one (or several soon™) of them. */ async getAlbums() { - try { - const response = await this.$axios.$get(`albums/dropdown`); - this.albums = response.albums; - this.updateDropzoneConfig(); - } catch (error) { - this.$onPromiseError(error); - } + const response = await this.$axios.$get(`albums/dropdown`); + this.albums = response.albums; + this.updateDropzoneConfig(); }, /* @@ -161,13 +157,15 @@ export default { */ dropzoneFilesAdded(files) { this.alreadyAddedFiles = true; - // console.log(files); }, dropzoneSuccess(file, response) { this.processResult(file, response); }, dropzoneError(file, message, xhr) { - this.$showToast('There was an error uploading this file. Check the console.', true, 5000); + this.$store.dispatch('alert', { + text: 'There was an error uploading this file. Check the console.', + error: true + }); console.error(file, message, xhr); }, dropzoneChunksUploaded(file, done) { @@ -190,7 +188,9 @@ export default { if (!response.url) return; file.previewTemplate.querySelector('.link').setAttribute('href', response.url); file.previewTemplate.querySelector('.copyLink').addEventListener('click', () => { - this.$showToast('Link copied!', false, 1000); + this.$store.dispatch('alert', { + text: 'Link copied!' + }); this.$clipboard(response.url); }); } |