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

@ -28,16 +28,14 @@ function drawNewFavicon(progressRatio) {
module.exports.updateFavicon = function(progressRatio) {
if (platform() === 'web') {
const link = document.querySelector("link[rel*='icon']");
const link = document.querySelector("link[rel='icon'][sizes='32x32']");
const progress = progressRatio * 100;
if (progress === 0 || progress === 100) {
link.type = 'image/png';
link.href = assets.get('favicon-32x32.png');
document.getElementsByTagName('head')[0].appendChild(link);
return;
}
link.href = drawNewFavicon(progressRatio);
document.getElementsByTagName('head')[0].appendChild(link);
}
};