query selector fix + revert favicon in case of cancel and complete

Co-authored-by: timvisee <tim@visee.me>
This commit is contained in:
Ashesh Vidyut 2019-03-22 03:52:16 +05:30 committed by timvisee
parent a3e8646ea7
commit e9b50b7682
No known key found for this signature in database
GPG key ID: B8DB720BC383E172
2 changed files with 4 additions and 3 deletions

View file

@ -86,6 +86,7 @@ export default function(state, emitter) {
emitter.on('cancel', () => {
state.transfer.cancel();
faviconProgressbar.updateFavicon(0);
});
emitter.on('addFiles', async ({ files }) => {
@ -164,6 +165,7 @@ export default function(state, emitter) {
state.storage.totalUploads += 1;
const duration = Date.now() - start;
metrics.completedUpload(archive, duration);
faviconProgressbar.updateFavicon(0);
state.storage.addFile(ownedFile);
// TODO integrate password into /upload request
@ -267,6 +269,7 @@ export default function(state, emitter) {
duration,
password_protected: file.requiresPassword
});
faviconProgressbar.updateFavicon(0);
} catch (err) {
if (err.message === '0') {
// download cancelled