diff options
| author | Pitu <[email protected]> | 2019-04-24 08:36:28 +0000 |
|---|---|---|
| committer | Pitu <[email protected]> | 2019-04-24 08:36:28 +0000 |
| commit | 3bd8d119ba88e940932eca50be406d50d73040fb (patch) | |
| tree | 9d24cdfc1edc53cce6670ffabb60597636571ecd /src/site/components/uploader/Uploader.vue | |
| parent | Get rid of the icons altogether in a future commit (diff) | |
| download | host.fuwn.me-3bd8d119ba88e940932eca50be406d50d73040fb.tar.xz host.fuwn.me-3bd8d119ba88e940932eca50be406d50d73040fb.zip | |
Refactor a bit since we globally catch API exceptions
Diffstat (limited to 'src/site/components/uploader/Uploader.vue')
| -rw-r--r-- | src/site/components/uploader/Uploader.vue | 20 |
1 files changed, 10 insertions, 10 deletions
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); }); } |