From 35b33263eaa506f4cca07245add6f87ae83e6435 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Tue, 31 Oct 2017 10:37:40 +0000 Subject: [PATCH] Use querystring lib --- src/components/views/elements/AppTile.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 06d223e8e5..cf41aad0bb 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -17,7 +17,7 @@ limitations under the License. 'use strict'; import url from 'url'; -import URLSearchParams from 'url-search-params'; +import qs from 'querystring'; import React from 'react'; import MatrixClientPeg from '../../../MatrixClientPeg'; import PlatformPeg from '../../../PlatformPeg'; @@ -127,10 +127,10 @@ export default React.createClass({ // Append scalar_token as a query param if not already present this._scalarClient.scalarToken = token; const u = url.parse(this.props.url); - const params = new URLSearchParams(u.search); - if (!params.get('scalar_token')) { - params.set('scalar_token', encodeURIComponent(token)); - u.search = params.toString(); + const params = qs(u.search); + if (!params.scalar_token) { + params.scalar_token = encodeURIComponent(token); + u.search = qs.stringify(params); } this.setState({