mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/api: don't call progress.done() on noProgress requests
It would cause the progress bar to disappear completely, and not render anymore after any noProgress request.
This commit is contained in:
@ -439,14 +439,18 @@ class Api extends events.EventTarget {
|
||||
|
||||
abortFunction = () => {
|
||||
req.abort(); // does *NOT* call the callback passed in .end()
|
||||
progress.done();
|
||||
if (!options.noProgress) {
|
||||
progress.done();
|
||||
}
|
||||
reject(
|
||||
new Error("The request was aborted due to user cancel.")
|
||||
);
|
||||
};
|
||||
|
||||
req.end((error, response) => {
|
||||
progress.done();
|
||||
if (!options.noProgress) {
|
||||
progress.done();
|
||||
}
|
||||
abortFunction = () => {};
|
||||
if (error) {
|
||||
if (response && response.body) {
|
||||
|
Reference in New Issue
Block a user