1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

Use utils.keys rather than Object.keys for older browsers.

This commit is contained in:
Kegan Dougal
2015-06-08 12:22:23 +01:00
parent a2257aeb0b
commit c73881f3fe

View File

@@ -80,7 +80,7 @@ module.exports.MatrixHttpApi.prototype = {
if (resizeMethod) {
params.method = resizeMethod;
}
if (Object.keys(params).length > 0) {
if (utils.keys(params).length > 0) {
// these are thumbnailing params so they probably want the
// thumbnailing API...
prefix = "/_matrix/media/v1/thumbnail/";
@@ -93,7 +93,7 @@ module.exports.MatrixHttpApi.prototype = {
serverAndMediaId = serverAndMediaId.substr(0, fragmentOffset);
}
return this.credentials.baseUrl + prefix + serverAndMediaId +
(Object.keys(params).length === 0 ? "" :
(utils.keys(params).length === 0 ? "" :
("?" + utils.encodeParams(params))) + fragment;
},
@@ -119,7 +119,7 @@ module.exports.MatrixHttpApi.prototype = {
$ident: identiconString
});
return this.credentials.baseUrl + path +
(Object.keys(params).length === 0 ? "" :
(utils.keys(params).length === 0 ? "" :
("?" + utils.encodeParams(params)));
},