Skip to content

Commit

Permalink
feat: update messages
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Henrique Dias <[email protected]>
  • Loading branch information
hacdias committed Apr 18, 2020
1 parent 1dcc092 commit 96b06c9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
12 changes: 6 additions & 6 deletions assets/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"ipfsIsRunning": "IPFS is running",
"ipfsIsStopping": "IPFS is stopping",
"ipfsIsStarting": "IPFS is starting",
"ipfsIsNotRunning": "IPFS is not running",
"ipfsHasErrored": "IPFS has errored",
"gcIsRunning": "Garbage Collector is running",
"ipfsIsRunning": "IPFS is Running",
"ipfsIsStopping": "IPFS is Stopping",
"ipfsIsStarting": "IPFS is Starting",
"ipfsIsNotRunning": "IPFS is Not Running",
"ipfsHasErrored": "IPFS has Errored",
"runningWithGC": "Running (Garbage Collecting)",
"start": "Start",
"stop": "Stop",
"restart": "Restart",
Expand Down
14 changes: 9 additions & 5 deletions src/tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function buildMenu (ctx) {
['ipfsIsStopping', 'yellow'],
['ipfsIsNotRunning', 'gray'],
['ipfsHasErrored', 'red'],
['gcIsRunning', 'yellow']
['runningWithGC', 'yellow']
].map(([status, color]) => ({
id: status,
label: i18n.t(status),
Expand Down Expand Up @@ -200,11 +200,15 @@ module.exports = function (ctx) {
menu.getMenuItemById('ipfsIsStopping').visible = status === STATUS.STOPPING_STARTED && !gcRunning
menu.getMenuItemById('ipfsIsNotRunning').visible = status === STATUS.STOPPING_FINISHED && !gcRunning
menu.getMenuItemById('ipfsHasErrored').visible = errored && !gcRunning
menu.getMenuItemById('gcIsRunning').visible = gcRunning
menu.getMenuItemById('restartIpfs').visible = (status === STATUS.STARTING_FINISHED || errored) && !gcRunning
menu.getMenuItemById('runningWithGC').visible = gcRunning

menu.getMenuItemById('startIpfs').visible = menu.getMenuItemById('ipfsIsNotRunning').visible
menu.getMenuItemById('stopIpfs').visible = menu.getMenuItemById('ipfsIsRunning').visible
menu.getMenuItemById('startIpfs').visible = status === STATUS.STOPPING_FINISHED
menu.getMenuItemById('stopIpfs').visible = status === STATUS.STARTING_FINISHED
menu.getMenuItemById('restartIpfs').visible = (status === STATUS.STARTING_FINISHED || errored)

menu.getMenuItemById('startIpfs').enabled = !gcRunning
menu.getMenuItemById('stopIpfs').enabled = !gcRunning
menu.getMenuItemById('restartIpfs').enabled = !gcRunning

menu.getMenuItemById('takeScreenshot').enabled = status === STATUS.STARTING_FINISHED
menu.getMenuItemById('downloadHash').enabled = status === STATUS.STARTING_FINISHED
Expand Down

0 comments on commit 96b06c9

Please sign in to comment.