Skip to content

Commit

Permalink
fix: show error message for failing upload
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb committed Jul 22, 2024
1 parent af5a303 commit 92e9453
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 19 deletions.
4 changes: 2 additions & 2 deletions js/photos-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-main.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-public.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-src_views_AlbumContent_vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-src_views_AlbumContent_vue.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/components/FilesPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
:context="uploadContext"
:destination="photosLocation"
:multiple="true"
@uploaded="refreshFiles" />
@uploaded="refreshFiles"
@failed="handleFailure" />
<NcButton type="primary" :disabled="loading || selectedFileIds.length === 0" @click="emitPickedEvent">
<template #icon>
<ImagePlus v-if="!loading" />
Expand Down Expand Up @@ -95,6 +96,7 @@ import FilesSelectionMixin from '../mixins/FilesSelectionMixin.js'
import FilesByMonthMixin from '../mixins/FilesByMonthMixin.js'
import UserConfig from '../mixins/UserConfig.js'
import allowedMimes from '../services/AllowedMimes.js'
import { showError } from '@nextcloud/dialogs'
export default {
name: 'FilesPicker',
Expand Down Expand Up @@ -179,6 +181,10 @@ export default {
emitPickedEvent() {
this.$emit('files-picked', this.selectedFileIds)
},
handleFailure() {
showError(t('photos', 'Could not upload the photo. If you are using photos for the first time, please ensure the "Photos" directory in your home folder does exist.'))
},
},
}
</script>
Expand Down

0 comments on commit 92e9453

Please sign in to comment.