Fix screen deletion not waiting for async operations to finish
This commit is contained in:
parent
085cfdccad
commit
6bc30eb5cb
|
@ -10,14 +10,15 @@
|
||||||
|
|
||||||
$: screen = $allScreens.find(screen => screen._id === screenId)
|
$: screen = $allScreens.find(screen => screen._id === screenId)
|
||||||
|
|
||||||
const deleteScreen = () => {
|
const deleteScreen = async () => {
|
||||||
try {
|
try {
|
||||||
store.actions.screens.delete(screen)
|
await store.actions.screens.delete(screen)
|
||||||
store.actions.routing.fetch()
|
await store.actions.routing.fetch()
|
||||||
confirmDeleteDialog.hide()
|
confirmDeleteDialog.hide()
|
||||||
$goto("../")
|
$goto("../")
|
||||||
notifications.success("Deleted screen successfully.")
|
notifications.success("Deleted screen successfully.")
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
notifications.error("Error deleting screen")
|
notifications.error("Error deleting screen")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue