mirror of
https://github.com/appium/appium-desktop.git
synced 2026-10-26 09:39:44 +08:00
23 lines
878 B
JavaScript
23 lines
878 B
JavaScript
import { ipcRenderer } from 'electron';
|
|
|
|
export const SET_ENVIRONMENT_VARIABLE = 'SET_ENVIRONMENT_VARIABLE';
|
|
export const SET_ENVIRONMENT_VARIABLES = 'SET_ENVIRONMENT_VARIABLES';
|
|
export const GET_ENVIRONMENT_VARIABLES = 'GET_ENVIRONMENT_VARIABLES';
|
|
export const SAVE_ENVIRONMENT_VARIABLES = 'SAVE_ENVIRONMENT_VARIABLES';
|
|
|
|
export function setEnvironmentVariable (name, value) {
|
|
return (dispatch) => {
|
|
dispatch({type: SET_ENVIRONMENT_VARIABLE, name, value});
|
|
};
|
|
}
|
|
|
|
export function getEnvironmentVariables () {
|
|
return (dispatch) => {
|
|
dispatch({type: GET_ENVIRONMENT_VARIABLES});
|
|
ipcRenderer.send('appium-get-env');
|
|
ipcRenderer.once('appium-env', (evt, env) => {
|
|
const {defaultEnvironmentVariables, savedEnvironmentVariables} = env;
|
|
dispatch({type: SET_ENVIRONMENT_VARIABLES, defaultEnvironmentVariables, savedEnvironmentVariables});
|
|
});
|
|
};
|
|
} |