Only try to match url if it's needed (#395)

This commit is contained in:
Albin Ekblom 2016-07-25 20:22:25 +02:00 committed by Guillermo Rauch
parent 0c328e9bab
commit 03e1f5f833

View file

@ -58,8 +58,11 @@ export function addSessionData (uid, data) {
data,
effect () {
const { shell } = getState().sessions.sessions[uid];
const url = getURL(shell, data);
if (null !== url) {
const enterKey = Boolean(data.match(/\n/));
const url = enterKey ? getURL(shell, data) : null;
if (url) {
dispatch({
type: SESSION_URL_SET,
uid,