From e3430260f946e673eaf41c81d3eefe5f67e80667 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 22 Jul 2022 14:03:33 -0500 Subject: [PATCH 1/4] firmware/alerts/NoDfuHub: fix translation key --- src/firmware/alerts/NoDfuHub.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/firmware/alerts/NoDfuHub.tsx b/src/firmware/alerts/NoDfuHub.tsx index 2ede5557a..5986f746e 100644 --- a/src/firmware/alerts/NoDfuHub.tsx +++ b/src/firmware/alerts/NoDfuHub.tsx @@ -26,7 +26,7 @@ const NoDfuHub: React.VoidFunctionComponent = () => { href={pybricksUsbDfuTroubleshootingUrl} target="_blank" > - {i18n.translate('noDfuHub.suggestion2')} + {i18n.translate('noDfuHub.troubleshootButton')} From 9d1f3651c59009d059cf22537dd5f509679ff57e Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 22 Jul 2022 14:45:47 -0500 Subject: [PATCH 2/4] alerts/actions: fix alertsShowAlert action with props --- src/alerts/actions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/alerts/actions.ts b/src/alerts/actions.ts index e50238e68..ce483d1be 100644 --- a/src/alerts/actions.ts +++ b/src/alerts/actions.ts @@ -22,7 +22,8 @@ export const alertsShowAlert = createAction( type: 'alerts.action.showAlert', domain, specific, - props, + // HACK: using varargs to allow props to be optional, but it is only one arg + props: props.at(0), }), ); From e6782cb29196964fc380f6ca85f7d7aa10ae3b3d Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 22 Jul 2022 15:07:10 -0500 Subject: [PATCH 3/4] index: avoid more non-serializable dev tool errors --- src/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 92ee13a11..0aa560fd9 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -47,9 +47,11 @@ const store = configureStore({ // copy of defaults 'meta.arg', 'meta.baseQueryMeta', - // HACK: technically serializable, can be removed after - // https://github.com/microsoft/vscode/pull/151993 + // monoco view state has class-based object but is technically serializable 'viewState.viewState.firstPosition', + // contain ArrayBuffer or DataView + 'data', + 'firmwareZip', ], }, }) From 934330272f070a471b7826ba4fc61a77bfa87d44 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 22 Jul 2022 15:29:11 -0500 Subject: [PATCH 4/4] alerts/sagas: avoid reentrancy for dismiss This fixes react complaining about calling setState from an invalid context. --- src/alerts/sagas.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/alerts/sagas.ts b/src/alerts/sagas.ts index f12a29c97..421b8c113 100644 --- a/src/alerts/sagas.ts +++ b/src/alerts/sagas.ts @@ -35,7 +35,9 @@ function* handleShowAlert(action: ReturnType): Generator try { const alertAction = yield* take(chan); // the dismiss actions will have called this already, but other actions don't - toaster.dismiss(key); + if (alertAction !== 'dismiss') { + toaster.dismiss(key); + } yield* put(alertsDidShowAlert(action.domain, action.specific, alertAction)); } finally {