mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
lint
This commit is contained in:
parent
b13cea7c6f
commit
c9d8692f26
3 changed files with 31 additions and 34 deletions
16
cli/api.ts
16
cli/api.ts
|
|
@ -108,15 +108,13 @@ function getPackageName(plugin: string) {
|
|||
|
||||
function existsOnNpm(plugin: string) {
|
||||
const name = getPackageName(plugin);
|
||||
return got
|
||||
.get<any>(registryUrl + name.toLowerCase(), {timeout: 10000, responseType: 'json'})
|
||||
.then((res) => {
|
||||
if (!res.body.versions) {
|
||||
return Promise.reject(res);
|
||||
} else {
|
||||
return res;
|
||||
}
|
||||
});
|
||||
return got.get<any>(registryUrl + name.toLowerCase(), {timeout: 10000, responseType: 'json'}).then((res) => {
|
||||
if (!res.body.versions) {
|
||||
return Promise.reject(res);
|
||||
} else {
|
||||
return res;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function install(plugin: string, locally?: boolean) {
|
||||
|
|
|
|||
|
|
@ -13,19 +13,20 @@ import {setActiveSession, ptyExitSession, userExitSession} from './sessions';
|
|||
import {ITermState, ITermGroup, HyperState, HyperDispatch, HyperActions} from '../hyper';
|
||||
|
||||
function requestSplit(direction: 'VERTICAL' | 'HORIZONTAL') {
|
||||
return (activeUid: string) => (dispatch: HyperDispatch, getState: () => HyperState): void => {
|
||||
dispatch({
|
||||
type: SESSION_REQUEST,
|
||||
effect: () => {
|
||||
const {ui, sessions} = getState();
|
||||
rpc.emit('new', {
|
||||
splitDirection: direction,
|
||||
cwd: ui.cwd,
|
||||
activeUid: activeUid ? activeUid : sessions.activeUid
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
return (activeUid: string) =>
|
||||
(dispatch: HyperDispatch, getState: () => HyperState): void => {
|
||||
dispatch({
|
||||
type: SESSION_REQUEST,
|
||||
effect: () => {
|
||||
const {ui, sessions} = getState();
|
||||
rpc.emit('new', {
|
||||
splitDirection: direction,
|
||||
cwd: ui.cwd,
|
||||
activeUid: activeUid ? activeUid : sessions.activeUid
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export const requestVerticalSplit = requestSplit(DIRECTION.VERTICAL);
|
||||
|
|
|
|||
|
|
@ -15,18 +15,16 @@ const getActivityMarkers = ({ui}: HyperState) => ui.activityMarkers;
|
|||
const getTabs = createSelector(
|
||||
[getSessions, getRootGroups, getActiveSessions, getActiveRootGroup, getActivityMarkers],
|
||||
(sessions, rootGroups, activeSessions, activeRootGroup, activityMarkers) =>
|
||||
rootGroups.map(
|
||||
(t): ITab => {
|
||||
const activeSessionUid = activeSessions[t.uid];
|
||||
const session = sessions[activeSessionUid];
|
||||
return {
|
||||
uid: t.uid,
|
||||
title: session.title,
|
||||
isActive: t.uid === activeRootGroup,
|
||||
hasActivity: activityMarkers[session.uid]
|
||||
};
|
||||
}
|
||||
)
|
||||
rootGroups.map((t): ITab => {
|
||||
const activeSessionUid = activeSessions[t.uid];
|
||||
const session = sessions[activeSessionUid];
|
||||
return {
|
||||
uid: t.uid,
|
||||
title: session.title,
|
||||
isActive: t.uid === activeRootGroup,
|
||||
hasActivity: activityMarkers[session.uid]
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
const mapStateToProps = (state: HyperState) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue