revert: Revert auto write user configuration (#558)
This commit is contained in:
committed by
László Monda
parent
c7baa00720
commit
a8108b9abf
@@ -90,7 +90,6 @@
|
||||
"server:web": "lerna exec --scope uhk-web npm start",
|
||||
"server:electron": "lerna exec --scope uhk-web npm run server:renderer",
|
||||
"electron": "lerna exec --scope uhk-agent npm start",
|
||||
"electron:auto-write-config": "lerna exec --scope uhk-agent npm run auto-write-config",
|
||||
"standard-version": "standard-version",
|
||||
"pack": "node ./scripts/release.js",
|
||||
"sprites": "node ./scripts/generate-svg-sprites",
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
},
|
||||
"scripts": {
|
||||
"start": "electron ./dist/electron-main.js",
|
||||
"auto-write-config": "electron ./dist/electron-main.js --auto-write-config",
|
||||
"build": "webpack && npm run install:build-deps && npm run build:usb && npm run download-firmware && npm run copy-blhost",
|
||||
"build:usb": "electron-rebuild -w node-hid -p -m ./dist",
|
||||
"install:build-deps": "cd ./dist && npm i",
|
||||
|
||||
@@ -21,8 +21,7 @@ import * as isDev from 'electron-is-dev';
|
||||
import { CommandLineInputs } from './models/command-line-inputs';
|
||||
|
||||
const optionDefinitions = [
|
||||
{name: 'addons', type: Boolean},
|
||||
{name: 'auto-write-config', type: Boolean}
|
||||
{name: 'addons', type: Boolean}
|
||||
];
|
||||
|
||||
const options: CommandLineInputs = commandLineArgs(optionDefinitions);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
export interface CommandLineInputs {
|
||||
addons?: boolean;
|
||||
'auto-write-config'?: boolean;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ export class AppService extends MainServiceBase {
|
||||
|
||||
const response: AppStartInfo = {
|
||||
commandLineArgs: {
|
||||
addons: this.options.addons || false,
|
||||
autoWriteConfig: this.options['auto-write-config'] || false
|
||||
addons: this.options.addons || false
|
||||
},
|
||||
deviceConnected: this.uhkHidDeviceService.deviceConnected(),
|
||||
hasPermission: this.uhkHidDeviceService.hasPermission()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
export interface CommandLineArgs {
|
||||
addons: boolean;
|
||||
autoWriteConfig: boolean;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ import {
|
||||
} from '../actions/app';
|
||||
import { AppRendererService } from '../../services/app-renderer.service';
|
||||
import { AppUpdateRendererService } from '../../services/app-update-renderer.service';
|
||||
import { ActionTypes as DeviceActions, ConnectionStateChangedAction, SaveToKeyboardSuccessAction } from '../actions/device';
|
||||
import { AppState, autoWriteUserConfiguration, runningInElectron } from '../index';
|
||||
import { ConnectionStateChangedAction } from '../actions/device';
|
||||
import { AppState, runningInElectron } from '../index';
|
||||
|
||||
@Injectable()
|
||||
export class ApplicationEffects {
|
||||
@@ -71,15 +71,6 @@ export class ApplicationEffects {
|
||||
.map(action => action.payload)
|
||||
.mergeMap((action: Action) => [action, new DismissUndoNotificationAction()]);
|
||||
|
||||
@Effect({dispatch: false}) saveToKeyboardSuccess$ = this.actions$
|
||||
.ofType<SaveToKeyboardSuccessAction>(DeviceActions.SAVE_TO_KEYBOARD_SUCCESS)
|
||||
.withLatestFrom(this.store.select(autoWriteUserConfiguration))
|
||||
.do(([action, autoWriteUserConfig]) => {
|
||||
if (autoWriteUserConfig) {
|
||||
this.appRendererService.exit();
|
||||
}
|
||||
});
|
||||
|
||||
@Effect({dispatch: false}) openUrlInNewWindow$ = this.actions$
|
||||
.ofType<OpenUrlInNewWindowAction>(ActionTypes.OPEN_URL_IN_NEW_WINDOW)
|
||||
.withLatestFrom(this.store.select(runningInElectron))
|
||||
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
|
||||
import { DataStorageRepositoryService } from '../../services/datastorage-repository.service';
|
||||
import { DefaultUserConfigurationService } from '../../services/default-user-configuration.service';
|
||||
import { AppState, autoWriteUserConfiguration, getPrevUserConfiguration, getUserConfiguration } from '../index';
|
||||
import { AppState, getPrevUserConfiguration, getUserConfiguration } from '../index';
|
||||
import { KeymapAction, KeymapActions, MacroAction, MacroActions } from '../actions';
|
||||
import {
|
||||
DismissUndoNotificationAction,
|
||||
@@ -43,7 +43,7 @@ import {
|
||||
ShowNotificationAction,
|
||||
UndoLastAction
|
||||
} from '../actions/app';
|
||||
import { SaveConfigurationAction, ShowSaveToKeyboardButtonAction } from '../actions/device';
|
||||
import { ShowSaveToKeyboardButtonAction } from '../actions/device';
|
||||
import { DeviceRendererService } from '../../services/device-renderer.service';
|
||||
import { UndoUserConfigData } from '../../models/undo-user-config-data';
|
||||
import { UploadFileData } from '../../models/upload-file-data';
|
||||
@@ -197,18 +197,6 @@ export class UserConfigEffects {
|
||||
saveAs(blob, 'UserConfiguration.bin');
|
||||
});
|
||||
|
||||
@Effect() loadUserConfigurationSuccess$ = this.actions$
|
||||
.ofType(ActionTypes.LOAD_USER_CONFIG_SUCCESS)
|
||||
.withLatestFrom(this.store.select(autoWriteUserConfiguration))
|
||||
.switchMap(([action, autoWriteUserConfig]) => {
|
||||
this.logService.debug('[UserConfigEffect] LOAD_USER_CONFIG_SUCCESS', {autoWriteUserConfig});
|
||||
if (autoWriteUserConfig) {
|
||||
return Observable.of(new SaveConfigurationAction());
|
||||
} else {
|
||||
return Observable.empty();
|
||||
}
|
||||
});
|
||||
|
||||
@Effect() loadUserConfigurationFromFile$ = this.actions$
|
||||
.ofType<LoadUserConfigurationFromFileAction>(ActionTypes.LOAD_USER_CONFIGURATION_FROM_FILE)
|
||||
.map(action => action.payload)
|
||||
|
||||
@@ -44,7 +44,6 @@ export const getDeviceName = createSelector(getUserConfiguration, fromUserConfig
|
||||
export const appState = (state: AppState) => state.app;
|
||||
|
||||
export const showAddonMenu = createSelector(appState, fromApp.showAddonMenu);
|
||||
export const autoWriteUserConfiguration = createSelector(appState, fromApp.autoWriteUserConfiguration);
|
||||
export const getUndoableNotification = createSelector(appState, fromApp.getUndoableNotification);
|
||||
export const getPrevUserConfiguration = createSelector(appState, fromApp.getPrevUserConfiguration);
|
||||
export const runningInElectron = createSelector(appState, fromApp.runningInElectron);
|
||||
|
||||
@@ -12,7 +12,6 @@ import { getVersions } from '../../util';
|
||||
export interface State {
|
||||
started: boolean;
|
||||
showAddonMenu: boolean;
|
||||
autoWriteUserConfiguration: boolean;
|
||||
undoableNotification?: Notification;
|
||||
navigationCountAfterNotification: number;
|
||||
prevUserConfig?: UserConfiguration;
|
||||
@@ -25,7 +24,6 @@ export interface State {
|
||||
export const initialState: State = {
|
||||
started: false,
|
||||
showAddonMenu: false,
|
||||
autoWriteUserConfiguration: false,
|
||||
navigationCountAfterNotification: 0,
|
||||
runningInElectron: runInElectron(),
|
||||
configLoading: true,
|
||||
@@ -44,8 +42,7 @@ export function reducer(state = initialState, action: Action & { payload: any })
|
||||
case ActionTypes.APPLY_COMMAND_LINE_ARGS: {
|
||||
return {
|
||||
...state,
|
||||
showAddonMenu: action.payload.addons,
|
||||
autoWriteUserConfiguration: action.payload.autoWriteConfig
|
||||
showAddonMenu: action.payload.addons
|
||||
};
|
||||
}
|
||||
|
||||
@@ -124,7 +121,6 @@ export function reducer(state = initialState, action: Action & { payload: any })
|
||||
}
|
||||
|
||||
export const showAddonMenu = (state: State) => state.showAddonMenu;
|
||||
export const autoWriteUserConfiguration = (state: State) => state.autoWriteUserConfiguration;
|
||||
export const getUndoableNotification = (state: State) => state.undoableNotification;
|
||||
export const getPrevUserConfiguration = (state: State) => state.prevUserConfig;
|
||||
export const runningInElectron = (state: State) => state.runningInElectron;
|
||||
|
||||
Reference in New Issue
Block a user