mirror of https://github.com/vladmandic/automatic
Implement error method for gallery progress
Handle instances when Web Crypto API is not available.pull/4644/head
parent
63c5e493be
commit
6971f3438c
|
|
@ -223,6 +223,15 @@ class SimpleProgressBar {
|
|||
this.#text.textContent = '';
|
||||
}
|
||||
|
||||
error(message) {
|
||||
this.#stop();
|
||||
clearTimeout(this.#hideTimeout);
|
||||
this.#text.textContent = message;
|
||||
this.#hideTimeout = setTimeout(() => {
|
||||
this.clear();
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
#update(loaded, max) {
|
||||
if (this.#hideTimeout) {
|
||||
this.#hideTimeout = null;
|
||||
|
|
@ -655,6 +664,7 @@ async function getHash(str) {
|
|||
return hex;
|
||||
} catch (err) {
|
||||
error('getHash:', err);
|
||||
galleryProgressBar.error('File hash error');
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue