mirror of https://github.com/vector-im/riot-web
Merge pull request #3851 from matrix-org/jryans/download-file-icon
Compute download file icon immediatelypull/21833/head
commit
e375b1d31f
|
@ -1,16 +1,17 @@
|
|||
const en = require("../src/i18n/strings/en_EN");
|
||||
|
||||
module.exports = jest.fn((opts, cb) => {
|
||||
if (opts.url.endsWith("languages.json")) {
|
||||
const url = opts.url || opts.uri;
|
||||
if (url && url.endsWith("languages.json")) {
|
||||
cb(undefined, {status: 200}, JSON.stringify({
|
||||
"en": {
|
||||
"fileName": "en_EN.json",
|
||||
"label": "English",
|
||||
},
|
||||
}));
|
||||
} else if (opts.url.endsWith("en_EN.json")) {
|
||||
} else if (url && url.endsWith("en_EN.json")) {
|
||||
cb(undefined, {status: 200}, JSON.stringify(en));
|
||||
} else {
|
||||
cb(undefined, {status: 404}, "");
|
||||
cb(true, {status: 404}, "");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -143,10 +143,14 @@ class Tinter {
|
|||
* over time then the best bet is to register a single callback for the
|
||||
* entire set.
|
||||
*
|
||||
* To ensure the tintable work happens at least once, it is also called as
|
||||
* part of registration.
|
||||
*
|
||||
* @param {Function} tintable Function to call when the tint changes.
|
||||
*/
|
||||
registerTintable(tintable) {
|
||||
this.tintables.push(tintable);
|
||||
tintable();
|
||||
}
|
||||
|
||||
getKeyRgb() {
|
||||
|
|
Loading…
Reference in New Issue