From 190143ca6ca74a04f51ad7af43dd2cafee73b6e5 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 17 Apr 2019 18:26:07 +0200 Subject: [PATCH] dispatch for user screen --- src/components/structures/MatrixChat.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index d96f349e21..33f1bac090 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -566,7 +566,7 @@ export default React.createClass({ }); break; case 'view_user_info': - this._viewUser(payload.userId); + this._viewUser(payload.userId, payload.subAction); break; case 'view_room': // Takes either a room ID or room alias: if switching to a room the client is already @@ -922,13 +922,13 @@ export default React.createClass({ this.notifyNewScreen('home'); }, - _viewUser: function(userId, action) { + _viewUser: function(userId, subAction) { // Wait for the first sync so that `getRoom` gives us a room object if it's // in the sync response const waitForSync = this.firstSyncPromise ? this.firstSyncPromise.promise : Promise.resolve(); waitForSync.then(() => { - if (action === 'chat') { + if (subAction === 'chat') { this._chatCreateOrReuse(userId); return; } @@ -1631,7 +1631,11 @@ export default React.createClass({ dis.dispatch(payload); } else if (screen.indexOf('user/') == 0) { const userId = screen.substring(5); - this._viewUser(userId, params.action); + dis.dispatch({ + action: 'view_user_info', + userId: userId, + subAction: params.action, + }); } else if (screen.indexOf('group/') == 0) { const groupId = screen.substring(6);