improve notification message for sync automation run

This commit is contained in:
Peter Clement 2023-05-16 09:59:37 +01:00
parent d43fc819c7
commit 59e1150eee
1 changed files with 7 additions and 3 deletions

View File

@ -130,14 +130,18 @@ const triggerAutomationHandler = async action => {
fields,
timeout,
})
if (!notificationOverride) {
notificationStore.actions.success("Automation triggered")
}
// Value will exist if automation is synchronous, so return it.
if (result.value) {
if (!notificationOverride) {
notificationStore.actions.success("Automation ran successfully")
}
return { result }
}
if (!notificationOverride) {
notificationStore.actions.success("Automation triggered")
}
} catch (error) {
// Abort next actions
return false