From 3c1312a9e6003c6633b3ff7b1850f8aed84af693 Mon Sep 17 00:00:00 2001 From: Minhaz A V Date: Sat, 5 Mar 2016 23:36:24 +0530 Subject: [PATCH 1/2] fixed issue vector-im/vector-web 1079 --- src/components/structures/MatrixChat.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 284edf62a1..c925e3f93d 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -589,7 +589,16 @@ module.exports = React.createClass({ var theAlias = MatrixTools.getCanonicalAliasForRoom(room); if (theAlias) presentedId = theAlias; } - self.notifyNewScreen('room/'+presentedId); + + if (typeof presentedId != 'undefined') { + self.notifyNewScreen('room/'+presentedId); + } else { + // There is no information on presentedId + // so point user to fallback like /directory + // TODO(mebjas): confirm if this is correct fallback + self.notifyNewScreen('directory'); + } + dis.dispatch({action: 'focus_composer'}); } else { self.setState({ready: true}); From 7e7493b3364a7abffbe658ab48b9aff217280ad9 Mon Sep 17 00:00:00 2001 From: Minhaz A V Date: Mon, 7 Mar 2016 21:16:35 +0530 Subject: [PATCH 2/2] removed typeof and todo Signed-off-by: Minhaz A V --- src/components/structures/MatrixChat.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index c925e3f93d..c189c6be10 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -590,12 +590,11 @@ module.exports = React.createClass({ if (theAlias) presentedId = theAlias; } - if (typeof presentedId != 'undefined') { + if (presentedId != undefined) { self.notifyNewScreen('room/'+presentedId); } else { // There is no information on presentedId // so point user to fallback like /directory - // TODO(mebjas): confirm if this is correct fallback self.notifyNewScreen('directory'); }