Add failure notification

This commit is contained in:
GHOSCHT 2022-03-15 00:14:01 +01:00
parent 2ee4d0df48
commit c31b2ddf9e
No known key found for this signature in database
GPG key ID: A35BD466B8871994

View file

@ -45,6 +45,8 @@ const serialConnection: Middleware<{}, RootState> = (state) => (next) => (action
electron.ipcRenderer.send("asynchronous-message", "default");
} else if (connectionFailure.match(action)) {
electron.ipcRenderer.send("asynchronous-message", "red");
const { Notification } = electron.remote;
new Notification({ title: "Connection Failure", body: action.payload }).show();
} else if (disconnect.match(action)) {
serialPort?.close();
state.dispatch(connectionEnd());