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/ipc redux #702

Merged
merged 9 commits into from
Apr 25, 2020
Prev Previous commit
Next Next commit
fix(store): add back restart api and stop api events
  • Loading branch information
Charles Jacquin committed Apr 22, 2020
commit ca05486d5a361ee7d00cfa4994618c66e9abe09e
6 changes: 3 additions & 3 deletions packages/core/src/persistence/store.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import _ from 'lodash';
import ElectronStore from 'electron-store';
import { ipcRenderer } from 'electron';

import { settingsConfig } from '../settings';
import { restartApi, stopApi } from '../mpris';

/**
* return multiple items from store
Expand Down Expand Up @@ -83,9 +83,9 @@ function setOption(key, value) {
(key === 'api.port' && isValidPort(value) && getOption('api.enabled')) ||
(key === 'api.enabled' && value)
) {
restartApi();
ipcRenderer.send('restart-api');
} else if (key === 'api.enabled' && !value) {
stopApi();
ipcRenderer.send('stop-api');
}
}

Expand Down