mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-22 14:05:12 +00:00
fixes
This commit is contained in:
parent
590f7abefd
commit
42c2969707
1 changed files with 8 additions and 9 deletions
|
@ -19,7 +19,6 @@ class FavIconDot {
|
|||
this.ctx = this.canvas.getContext('2d');
|
||||
|
||||
this.faviconImage = document.createElement('img');
|
||||
this.faviconImage.src = this.faviconEL.href;
|
||||
|
||||
this.hasLoaded = new Promise((resolve, reject) => {
|
||||
(this.faviconImage as HTMLImageElement).onload = () => {
|
||||
|
@ -32,12 +31,13 @@ class FavIconDot {
|
|||
reject('Failed to create favicon img element');
|
||||
};
|
||||
});
|
||||
|
||||
this.faviconImage.src = this.faviconEL.href;
|
||||
}
|
||||
|
||||
private async getOrMakeFaviconElement() : Promise<HTMLLinkElement> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const favicon = document.querySelector<HTMLLinkElement>('link[rel$=icon]') ?? this._createFaviconElem();
|
||||
if (favicon === document.querySelector<HTMLLinkElement>('link[rel$=icon]')) {
|
||||
favicon.onload = () => {
|
||||
resolve(favicon);
|
||||
};
|
||||
|
@ -45,7 +45,6 @@ class FavIconDot {
|
|||
favicon.onerror = () => {
|
||||
reject('Failed to load favicon');
|
||||
};
|
||||
}
|
||||
resolve(favicon);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue