You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-11 20:22:36 +03:00
Use querystring lib
This commit is contained in:
@@ -17,7 +17,7 @@ limitations under the License.
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import url from 'url';
|
import url from 'url';
|
||||||
import URLSearchParams from 'url-search-params';
|
import qs from 'querystring';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||||
import PlatformPeg from '../../../PlatformPeg';
|
import PlatformPeg from '../../../PlatformPeg';
|
||||||
@@ -127,10 +127,10 @@ export default React.createClass({
|
|||||||
// Append scalar_token as a query param if not already present
|
// Append scalar_token as a query param if not already present
|
||||||
this._scalarClient.scalarToken = token;
|
this._scalarClient.scalarToken = token;
|
||||||
const u = url.parse(this.props.url);
|
const u = url.parse(this.props.url);
|
||||||
const params = new URLSearchParams(u.search);
|
const params = qs(u.search);
|
||||||
if (!params.get('scalar_token')) {
|
if (!params.scalar_token) {
|
||||||
params.set('scalar_token', encodeURIComponent(token));
|
params.scalar_token = encodeURIComponent(token);
|
||||||
u.search = params.toString();
|
u.search = qs.stringify(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|||||||
Reference in New Issue
Block a user