mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 21:58:39 -09:00
check for null/undefined session in addSessionData (#1698)
* check for null/undefined session in addSessionData * Update sessions.js
This commit is contained in:
parent
aa7e79a039
commit
af21493e2b
1 changed files with 16 additions and 15 deletions
|
|
@ -53,22 +53,23 @@ export function addSessionData(uid, data) {
|
||||||
type: SESSION_ADD_DATA,
|
type: SESSION_ADD_DATA,
|
||||||
data,
|
data,
|
||||||
effect() {
|
effect() {
|
||||||
const {shell} = getState().sessions.sessions[uid];
|
const session = getState().sessions.sessions[uid];
|
||||||
const enterKey = data.indexOf('\n') > 0;
|
if (session) {
|
||||||
const url = enterKey ? isUrl(shell, data) : null;
|
const enterKey = data.indexOf('\n') > 0;
|
||||||
if (url) {
|
const url = enterKey ? isUrl(session.shell, data) : null;
|
||||||
dispatch({
|
if (url) {
|
||||||
type: SESSION_URL_SET,
|
return dispatch({
|
||||||
uid,
|
type: SESSION_URL_SET,
|
||||||
url
|
uid,
|
||||||
});
|
url
|
||||||
} else {
|
});
|
||||||
dispatch({
|
}
|
||||||
type: SESSION_PTY_DATA,
|
|
||||||
uid,
|
|
||||||
data
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
dispatch({
|
||||||
|
type: SESSION_PTY_DATA,
|
||||||
|
uid,
|
||||||
|
data
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue