Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: notify when toggling option fails (desktop) #1146

Merged
merged 12 commits into from
Sep 12, 2019
6 changes: 6 additions & 0 deletions public/locales/en/notify.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@
"connectedToPeer": "Successfully connected to the provided peer.",
"experimentsErrors": {
"npmOnIpfs": "We couldn't make changes to your system. Please install or uninstall 'ipfs-npm' package manually."
},
"desktopToggleErrors": {
"autoLaunch": "Could not toggle launch at startup option.",
"ipfsOnPath": "Could not toggle IPFS command line tools.",
"downloadHashShortcut": "Could not toggle download hash shortcut.",
"screenshotShortcut": "Could not toggle screenshot shortcut."
}
}
10 changes: 10 additions & 0 deletions src/bundles/notify.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createSelector } from 'redux-bundler'
import { ACTIONS as EXP_ACTIONS } from './experiments'
import { ACTIONS as FILES_ACTIONS } from './files'
import { ACTIONS as DESK_ACTIONS } from './ipfs-desktop'

/*
# Notify
Expand Down Expand Up @@ -70,6 +71,15 @@ const notify = {
}
}

if (action.type === DESK_ACTIONS.SETTING_TOGGLE_FAILED) {
return {
...state,
show: true,
error: true,
eventId: `desktopToggleErrors.${action.payload.key}`
}
}

return state
},

Expand Down