Skip to content

Commit

Permalink
Panel notification: improve timeout handling
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed Apr 30, 2024
1 parent e2c2632 commit ca7966d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion panel/src/panel/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ export default (panel = {}) => {
return this.success(notification);
}

// add timeout if not error or fatal notification
if (notification.type !== "error" && notification.type !== "fatal") {
notification.timeout ??= 4000;
}

// set the new state
this.set({
// add the current editing context
Expand Down Expand Up @@ -211,7 +216,6 @@ export default (panel = {}) => {
return this.open({
icon: "check",
theme: "positive",
timeout: 4000,
...success
});
},
Expand Down

0 comments on commit ca7966d

Please sign in to comment.