mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Fix code style
This commit is contained in:
parent
220b29c6c7
commit
c3e4cbebe4
3 changed files with 131 additions and 131 deletions
|
|
@ -67,14 +67,14 @@ const reducer = (state = initialState, action) => {
|
|||
|
||||
case SESSION_PTY_DATA:
|
||||
return state
|
||||
.set('write', Write(action))
|
||||
.merge({
|
||||
sessions: {
|
||||
[action.uid]: {
|
||||
cleared: false
|
||||
.set('write', Write(action))
|
||||
.merge({
|
||||
sessions: {
|
||||
[action.uid]: {
|
||||
cleared: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}, { deep: true });
|
||||
}, { deep: true });
|
||||
|
||||
case SESSION_PTY_EXIT:
|
||||
if (state.sessions[action.uid]) {
|
||||
|
|
|
|||
|
|
@ -75,73 +75,73 @@ const reducer = (state = initial, action) => {
|
|||
case CONFIG_RELOAD:
|
||||
const { config } = action;
|
||||
state_ = state
|
||||
// we unset the user font size override if the
|
||||
// font size changed from the config
|
||||
.merge((() => {
|
||||
const ret = {};
|
||||
// we unset the user font size override if the
|
||||
// font size changed from the config
|
||||
.merge((() => {
|
||||
const ret = {};
|
||||
|
||||
if (state.fontSizeOverride && config.fontSize !== state.fontSize) {
|
||||
ret.fontSizeOverride = null;
|
||||
}
|
||||
if (state.fontSizeOverride && config.fontSize !== state.fontSize) {
|
||||
ret.fontSizeOverride = null;
|
||||
}
|
||||
|
||||
if (null != config.fontSize) {
|
||||
ret.fontSize = config.fontSize;
|
||||
}
|
||||
if (null != config.fontSize) {
|
||||
ret.fontSize = config.fontSize;
|
||||
}
|
||||
|
||||
if (null != config.fontFamily) {
|
||||
ret.fontFamily = config.fontFamily;
|
||||
}
|
||||
if (null != config.fontFamily) {
|
||||
ret.fontFamily = config.fontFamily;
|
||||
}
|
||||
|
||||
if (null != config.cursorColor) {
|
||||
ret.cursorColor = config.cursorColor;
|
||||
}
|
||||
if (null != config.cursorColor) {
|
||||
ret.cursorColor = config.cursorColor;
|
||||
}
|
||||
|
||||
if (allowedCursorShapes.includes(config.cursorShape)) {
|
||||
ret.cursorShape = config.cursorShape;
|
||||
}
|
||||
if (allowedCursorShapes.includes(config.cursorShape)) {
|
||||
ret.cursorShape = config.cursorShape;
|
||||
}
|
||||
|
||||
if (null != config.borderColor) {
|
||||
ret.borderColor = config.borderColor;
|
||||
}
|
||||
if (null != config.borderColor) {
|
||||
ret.borderColor = config.borderColor;
|
||||
}
|
||||
|
||||
if (null != config.padding) {
|
||||
ret.padding = config.padding;
|
||||
}
|
||||
if (null != config.padding) {
|
||||
ret.padding = config.padding;
|
||||
}
|
||||
|
||||
if (null != config.foregroundColor) {
|
||||
ret.foregroundColor = config.foregroundColor;
|
||||
}
|
||||
if (null != config.foregroundColor) {
|
||||
ret.foregroundColor = config.foregroundColor;
|
||||
}
|
||||
|
||||
if (null != config.backgroundColor) {
|
||||
ret.backgroundColor = config.backgroundColor;
|
||||
}
|
||||
if (null != config.backgroundColor) {
|
||||
ret.backgroundColor = config.backgroundColor;
|
||||
}
|
||||
|
||||
if (null != config.css) {
|
||||
ret.css = config.css;
|
||||
}
|
||||
if (null != config.css) {
|
||||
ret.css = config.css;
|
||||
}
|
||||
|
||||
if (null != config.termCSS) {
|
||||
ret.termCSS = config.termCSS;
|
||||
}
|
||||
if (null != config.termCSS) {
|
||||
ret.termCSS = config.termCSS;
|
||||
}
|
||||
|
||||
if (null != config.colors) {
|
||||
if (Array.isArray(config.colors)) {
|
||||
const stateColors = Array.isArray(state.colors)
|
||||
? state.colors
|
||||
: values(state.colors);
|
||||
if (null != config.colors) {
|
||||
if (Array.isArray(config.colors)) {
|
||||
const stateColors = Array.isArray(state.colors)
|
||||
? state.colors
|
||||
: values(state.colors);
|
||||
|
||||
if (stateColors.toString() !== config.colors.toString()) {
|
||||
ret.colors = config.colors;
|
||||
}
|
||||
} else {
|
||||
if (JSON.stringify(state.colors) !== JSON.stringify(config.colors)) {
|
||||
ret.colors = config.colors;
|
||||
if (stateColors.toString() !== config.colors.toString()) {
|
||||
ret.colors = config.colors;
|
||||
}
|
||||
} else {
|
||||
if (JSON.stringify(state.colors) !== JSON.stringify(config.colors)) {
|
||||
ret.colors = config.colors;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
})());
|
||||
return ret;
|
||||
})());
|
||||
break;
|
||||
|
||||
case SESSION_ADD:
|
||||
|
|
@ -162,16 +162,16 @@ const reducer = (state = initial, action) => {
|
|||
|
||||
case SESSION_PTY_EXIT:
|
||||
state_ = state
|
||||
.updateIn(['openAt'], (times) => {
|
||||
const times_ = times.asMutable();
|
||||
delete times_[action.uid];
|
||||
return times_;
|
||||
})
|
||||
.updateIn(['activityMarkers'], (markers) => {
|
||||
const markers_ = markers.asMutable();
|
||||
delete markers_[action.uid];
|
||||
return markers_;
|
||||
});
|
||||
.updateIn(['openAt'], (times) => {
|
||||
const times_ = times.asMutable();
|
||||
delete times_[action.uid];
|
||||
return times_;
|
||||
})
|
||||
.updateIn(['activityMarkers'], (markers) => {
|
||||
const markers_ = markers.asMutable();
|
||||
delete markers_[action.uid];
|
||||
return markers_;
|
||||
});
|
||||
break;
|
||||
|
||||
case SESSION_SET_ACTIVE:
|
||||
|
|
|
|||
|
|
@ -63,87 +63,87 @@ const loadModules = () => {
|
|||
termPropsDecorators = [];
|
||||
|
||||
modules = paths.plugins.concat(paths.localPlugins)
|
||||
.map((path) => {
|
||||
let mod;
|
||||
const pluginName = getPluginName(path);
|
||||
.map((path) => {
|
||||
let mod;
|
||||
const pluginName = getPluginName(path);
|
||||
|
||||
// window.require allows us to ensure this doesn't get
|
||||
// in the way of our build
|
||||
try {
|
||||
mod = window.require(path);
|
||||
} catch (err) {
|
||||
console.error(err.stack);
|
||||
notify('Plugin load error', `"${pluginName}" failed to load in the renderer process. Check Developer Tools for details.`);
|
||||
return;
|
||||
}
|
||||
// window.require allows us to ensure this doesn't get
|
||||
// in the way of our build
|
||||
try {
|
||||
mod = window.require(path);
|
||||
} catch (err) {
|
||||
console.error(err.stack);
|
||||
notify('Plugin load error', `"${pluginName}" failed to load in the renderer process. Check Developer Tools for details.`);
|
||||
return;
|
||||
}
|
||||
|
||||
for (const i in mod) {
|
||||
mod[i]._pluginName = pluginName;
|
||||
}
|
||||
for (const i in mod) {
|
||||
mod[i]._pluginName = pluginName;
|
||||
}
|
||||
|
||||
if (mod.middleware) {
|
||||
middlewares.push(mod.middleware);
|
||||
}
|
||||
if (mod.middleware) {
|
||||
middlewares.push(mod.middleware);
|
||||
}
|
||||
|
||||
if (mod.reduceUI) {
|
||||
uiReducers.push(mod.reduceUI);
|
||||
}
|
||||
if (mod.reduceUI) {
|
||||
uiReducers.push(mod.reduceUI);
|
||||
}
|
||||
|
||||
if (mod.reduceSessions) {
|
||||
sessionsReducers.push(mod.reduceSessions);
|
||||
}
|
||||
if (mod.reduceSessions) {
|
||||
sessionsReducers.push(mod.reduceSessions);
|
||||
}
|
||||
|
||||
if (mod.mapTermsState) {
|
||||
connectors.Terms.state.push(mod.mapTermsState);
|
||||
}
|
||||
if (mod.mapTermsState) {
|
||||
connectors.Terms.state.push(mod.mapTermsState);
|
||||
}
|
||||
|
||||
if (mod.mapTermsDispatch) {
|
||||
connectors.Terms.dispatch.push(mod.mapTermsDispatch);
|
||||
}
|
||||
if (mod.mapTermsDispatch) {
|
||||
connectors.Terms.dispatch.push(mod.mapTermsDispatch);
|
||||
}
|
||||
|
||||
if (mod.mapHeaderState) {
|
||||
connectors.Header.state.push(mod.mapHeaderState);
|
||||
}
|
||||
if (mod.mapHeaderState) {
|
||||
connectors.Header.state.push(mod.mapHeaderState);
|
||||
}
|
||||
|
||||
if (mod.mapHeaderDispatch) {
|
||||
connectors.Header.dispatch.push(mod.mapHeaderDispatch);
|
||||
}
|
||||
if (mod.mapHeaderDispatch) {
|
||||
connectors.Header.dispatch.push(mod.mapHeaderDispatch);
|
||||
}
|
||||
|
||||
if (mod.mapHyperTermState) {
|
||||
connectors.HyperTerm.state.push(mod.mapHyperTermState);
|
||||
}
|
||||
if (mod.mapHyperTermState) {
|
||||
connectors.HyperTerm.state.push(mod.mapHyperTermState);
|
||||
}
|
||||
|
||||
if (mod.mapHyperTermDispatch) {
|
||||
connectors.HyperTerm.dispatch.push(mod.mapHyperTermDispatch);
|
||||
}
|
||||
if (mod.mapHyperTermDispatch) {
|
||||
connectors.HyperTerm.dispatch.push(mod.mapHyperTermDispatch);
|
||||
}
|
||||
|
||||
if (mod.mapNotificationsState) {
|
||||
connectors.Notifications.state.push(mod.mapNotificationsState);
|
||||
}
|
||||
if (mod.mapNotificationsState) {
|
||||
connectors.Notifications.state.push(mod.mapNotificationsState);
|
||||
}
|
||||
|
||||
if (mod.mapNotificationsDispatch) {
|
||||
connectors.Notifications.dispatch.push(mod.mapNotificationsDispatch);
|
||||
}
|
||||
if (mod.mapNotificationsDispatch) {
|
||||
connectors.Notifications.dispatch.push(mod.mapNotificationsDispatch);
|
||||
}
|
||||
|
||||
if (mod.getTermProps) {
|
||||
termPropsDecorators.push(mod.getTermProps);
|
||||
}
|
||||
if (mod.getTermProps) {
|
||||
termPropsDecorators.push(mod.getTermProps);
|
||||
}
|
||||
|
||||
if (mod.getTabProps) {
|
||||
tabPropsDecorators.push(mod.getTabProps);
|
||||
}
|
||||
if (mod.getTabProps) {
|
||||
tabPropsDecorators.push(mod.getTabProps);
|
||||
}
|
||||
|
||||
if (mod.getTabsProps) {
|
||||
tabsPropsDecorators.push(mod.getTabsProps);
|
||||
}
|
||||
if (mod.getTabsProps) {
|
||||
tabsPropsDecorators.push(mod.getTabsProps);
|
||||
}
|
||||
|
||||
if (mod.onRendererWindow) {
|
||||
mod.onRendererWindow(window);
|
||||
}
|
||||
if (mod.onRendererWindow) {
|
||||
mod.onRendererWindow(window);
|
||||
}
|
||||
|
||||
return mod;
|
||||
})
|
||||
.filter((mod) => !!mod);
|
||||
return mod;
|
||||
})
|
||||
.filter((mod) => !!mod);
|
||||
};
|
||||
|
||||
// load modules for initial decoration
|
||||
|
|
|
|||
Loading…
Reference in a new issue