Skip to content

Commit

Permalink
Added noToast field for "cmd" extension messages
Browse files Browse the repository at this point in the history
If eventMsg.data contains ".noToast" with a true value and
the command results in an error, the error message toast will
be suppressed.  That lets the extension handle errors internally
without the user seeing a possibly-confusing message.

One use case is when the extension needs to issue a command
that might not exist in older versions of the controller
firmware, handling the error quietly for backwards compatibility.
  • Loading branch information
MitchBradley committed Jun 22, 2024
1 parent f741bc3 commit d58ceff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/areas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ const ContentContainer = () => {
)
},
onFail: (error) => {
toasts.addToast({
content: error,
type: "error",
})
if (!eventMsg.data.noToast) {
toasts.addToast({
content: error,
type: "error",
})
}
console.log(error)
if (!eventMsg.data.noDispatch)
dispatchToExtensions(
Expand Down

0 comments on commit d58ceff

Please sign in to comment.