Hide image instead of setting it to blank
This commit is contained in:
parent
becaf79690
commit
c1f61cfe9b
1 changed files with 5 additions and 4 deletions
|
@ -6,8 +6,6 @@ import { findButtonOrFail, findFormOrFail, findImageOrFail, findInputOrFail, fin
|
|||
import knownSoftware from "./known_software.mjs";
|
||||
import { Instance } from "./storage_manager.mjs";
|
||||
|
||||
const blankImage = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
||||
|
||||
export function mergeHost(host: string, secure: boolean): string {
|
||||
return `http${secure ? "s" : ""}://${host}`;
|
||||
}
|
||||
|
@ -85,7 +83,7 @@ export class InstanceDetailsDialog extends FormDialog {
|
|||
this.instanceSoftware.appendChild(option);
|
||||
}
|
||||
|
||||
this.instanceIcon.src = blankImage;
|
||||
this.instanceIcon.hidden = true;
|
||||
|
||||
this.closeButton.addEventListener("click", e => this.close());
|
||||
|
||||
|
@ -172,7 +170,10 @@ export class InstanceDetailsDialog extends FormDialog {
|
|||
this.instanceHost.value = data.host;
|
||||
this.instanceHostSecure.checked = data.hostSecure;
|
||||
this.instanceSoftware.value = data.software;
|
||||
this.instanceIcon.src = data.iconURL ?? blankImage;
|
||||
if (data.iconURL !== null) {
|
||||
this.instanceIcon.src = data.iconURL;
|
||||
this.instanceIcon.hidden = false;
|
||||
} else this.instanceIcon.hidden = true;
|
||||
this.#populateDefaultsList(data.preferredFor);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue