Skip to content

Commit

Permalink
Clear selection after action, reload inbox & only navigate to things …
Browse files Browse the repository at this point in the history
…page if approve

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 committed Mar 10, 2025
1 parent 77f17c7 commit cda7d13
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ export default {
},
performActionOnSelection (action) {
let progressMessage, successMessage, promises
let navigateToThingsPage = false
switch (action) {
case 'delete':
progressMessage = 'Removing Inbox Entries...'
Expand All @@ -432,6 +433,7 @@ export default {
progressMessage = 'Approving Inbox Entries...'
successMessage = `${this.selectedItems.length} entries approved`
promises = this.filterSelectedItems().map((e) => this.$oh.api.postPlain('/rest/inbox/' + e.thingUID + '/approve', e.label))
navigateToThingsPage = true
break
case 'ignore':
progressMessage = 'Ignoring Inbox Entries...'
Expand Down Expand Up @@ -463,18 +465,22 @@ export default {
let dialog = this.$f7.dialog.progress(progressMessage)
Promise.all(promises).then((data) => {
Promise.all(promises).then(() => {
this.$f7.toast.create({
text: successMessage,
destroyOnClose: true,
closeTimeout: 2000
}).open()
this.selectedItems = []
dialog.close()
this.$f7router.navigate('/settings/things/', {
props: {
searchFor: this.selectedItems.join(',')
}
})
this.load()
if (navigateToThingsPage) {
this.$f7router.navigate('/settings/things/', {
props: {
searchFor: this.selectedItems.join(',')
}
})
}
}).catch((err) => {
dialog.close()
this.load()
Expand Down

0 comments on commit cda7d13

Please sign in to comment.