Added remove remote mount
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as Constants from '../../constants';
|
||||
import {createAction} from 'redux-starter-kit';
|
||||
import {getIPCRenderer} from '../../utils';
|
||||
import {confirmYesNo, displayConfirmYesNo} from './common_actions';
|
||||
|
||||
export const DISPLAY_CONFIGURATION = 'mounts/displayConfiguration';
|
||||
export const displayConfiguration = (provider, remote) => {
|
||||
@@ -13,6 +14,31 @@ export const displayConfiguration = (provider, remote) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const removeRemoteMount = provider => {
|
||||
return dispatch => {
|
||||
dispatch(confirmYesNo('Delete [' + provider.substr(6) + ']?'))
|
||||
.then(confirmed => {
|
||||
if (confirmed) {
|
||||
dispatch(removeRemoteMount2(provider));
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
const removeRemoteMount2 = provider => {
|
||||
return dispatch => {
|
||||
const ipcRenderer = getIPCRenderer();
|
||||
ipcRenderer.once(Constants.IPC_Remove_Remote_Mount_Reply, (_, arg) => {
|
||||
if (arg.data.Success) {
|
||||
dispatch(removeRemoteMount3(provider));
|
||||
}
|
||||
});
|
||||
ipcRenderer.send(Constants.IPC_Remove_Remote_Mount, provider.substr(6));
|
||||
};
|
||||
};
|
||||
|
||||
export const removeRemoteMount3 = createAction('mounts/removeRemoteMount3');
|
||||
|
||||
export const RESET_MOUNTS_STATE = 'mounts/resetMountsState';
|
||||
export const resetMountsState = () => {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user