Skip to content

Commit ce0a04f

Browse files
authored
Merge branch 'develop' into chore/toast-tests
2 parents b8cf1a2 + 9703e10 commit ce0a04f

24 files changed

+496
-721
lines changed

client/components/Nav.jsx

Lines changed: 0 additions & 417 deletions
This file was deleted.

client/components/Nav.unit.test.jsx

Lines changed: 0 additions & 69 deletions
This file was deleted.

client/modules/IDE/actions/toast.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,24 @@ export function hideToast() {
66
};
77
}
88

9-
export function showToast(time) {
9+
/**
10+
* Temporary fix until #2206 is merged.
11+
* Supports legacy two-action syntax:
12+
* dispatch(setToastText('Toast.SketchFailedSave'));
13+
* dispatch(showToast(1500));
14+
* And also supports proposed single-action syntax with message and optional timeout.
15+
* dispatch(showToast('Toast.SketchFailedSave'));
16+
* dispatch(showToast('Toast.SketchSaved', 5500));
17+
*/
18+
export function showToast(textOrTime, timeout = 1500) {
1019
return (dispatch) => {
20+
let time = timeout;
21+
if (typeof textOrTime === 'string') {
22+
// eslint-disable-next-line no-use-before-define
23+
dispatch(setToastText(textOrTime));
24+
} else {
25+
time = textOrTime;
26+
}
1127
dispatch({
1228
type: ActionTypes.SHOW_TOAST
1329
});

0 commit comments

Comments
 (0)