Revert "Refactor OTA update handling and improve error reporting."
This reverts commit 7c128a27eb.
This commit is contained in:
@@ -3,7 +3,7 @@ class ToastService {
|
||||
private stylesInjected = false;
|
||||
|
||||
constructor() {
|
||||
this.container = document.getElementById('toast-container') as HTMLElement;
|
||||
this.container = this.ensureContainer();
|
||||
this.injectStyles();
|
||||
}
|
||||
|
||||
@@ -41,6 +41,16 @@ class ToastService {
|
||||
return div;
|
||||
}
|
||||
|
||||
private ensureContainer(): HTMLElement {
|
||||
let container = document.getElementById('toast-container');
|
||||
if (!container) {
|
||||
container = document.createElement('div');
|
||||
container.id = 'toast-container';
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
return container;
|
||||
}
|
||||
|
||||
private injectStyles() {
|
||||
if (this.stylesInjected) return;
|
||||
const style = document.createElement('style');
|
||||
|
||||
Reference in New Issue
Block a user