mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 10:15:43 +03:00
Merge pull request #3851 from matrix-org/jryans/download-file-icon
Compute download file icon immediately
This commit is contained in:
commit
e375b1d31f
2 changed files with 8 additions and 3 deletions
|
@ -1,16 +1,17 @@
|
||||||
const en = require("../src/i18n/strings/en_EN");
|
const en = require("../src/i18n/strings/en_EN");
|
||||||
|
|
||||||
module.exports = jest.fn((opts, cb) => {
|
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({
|
cb(undefined, {status: 200}, JSON.stringify({
|
||||||
"en": {
|
"en": {
|
||||||
"fileName": "en_EN.json",
|
"fileName": "en_EN.json",
|
||||||
"label": "English",
|
"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));
|
cb(undefined, {status: 200}, JSON.stringify(en));
|
||||||
} else {
|
} 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
|
* over time then the best bet is to register a single callback for the
|
||||||
* entire set.
|
* 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.
|
* @param {Function} tintable Function to call when the tint changes.
|
||||||
*/
|
*/
|
||||||
registerTintable(tintable) {
|
registerTintable(tintable) {
|
||||||
this.tintables.push(tintable);
|
this.tintables.push(tintable);
|
||||||
|
tintable();
|
||||||
}
|
}
|
||||||
|
|
||||||
getKeyRgb() {
|
getKeyRgb() {
|
||||||
|
|
Loading…
Reference in a new issue