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