Comments (6)
Does it happen only for animation type 'none' or also for others?
from favico.js.
I don't think so. I justed tried but animations with none slide fade
all run into this problem.
And I got some logs, which made me think it breaks every time I set badge 0
after _running
was set to true
.
2014-08-15T08:23:26.108Z badge -> 0
2014-08-15T08:23:26.555Z badge -> 0
2014-08-15T08:23:26.659Z badge -> 1
2014-08-15T08:23:26.660Z running -> true favico.js:173
2014-08-15T08:23:26.669Z badge -> 0 <-- I think the problem is here.
2014-08-15T08:23:32.275Z badge -> 1
2014-08-15T08:23:32.276Z badge -> 0
2014-08-15T08:23:32.672Z badge -> 1
2014-08-15T08:23:32.939Z badge -> 2
from favico.js.
I think my issue can be fixed by resetting _running
to false
when I reset the badge. Global state makes me anxious, and I'm not sure if it would affect other parts of you code.
I want to send a PR if you think that line is OK.
/**
* Set badge
*/
var badge = function(number, opts) {
opts = ((typeof opts)==='string' ? {animation:opts} : opts) || {};
_readyCb = function() {
try {
if (typeof(number)==='number' ? (number > 0) : (number !== '')) {
//
// too long...
//
_queue.push(q);
icon.start();
} else {
icon.reset();
_running = false; // <-- I added two lines here
console.log((new Date()).toISOString(), 'running -> false, forced');
}
} catch(e) {
throw 'Error setting badge. Message: ' + e.message;
}
};
if (_ready) {
_readyCb();
}
};
from favico.js.
Good catch!
Send a pull request I will test it and merge it to next version. And I will also make the repo smaller for bower.
Thanks
from favico.js.
Any status updates on getting this merged?
from favico.js.
Merged. I will do few more fixes this weekend.
from favico.js.
Related Issues (20)
- Can't get it working HOT 1
- SHOPIFY
- Webcam example don't work because of https HOT 7
- Need to show badge number just after fav icon
- navigator.getUserMedia chrome [Deprecation] HTTPS
- favicon does not get updated in bookmarks
- Safari 12: get Apple to support dynamic favicons (dupe my bug report)
- Angular +2 Support? HOT 1
- Customizable badge size
- No api to update favicon color, animation style etc after initialisation. HOT 1
- Licensing HOT 2
- Firefox 46: Bug on drawing favicon when no link tag is used
- Doesn't disappear when value is zero HOT 1
- Doesn't work with Chrome 78 (most of the time) HOT 1
- Support for Vue
- Font icon problem HOT 1
- what if queue lenght is more then 100 ?
- Reset favicon HOT 1
- Firefox warning: InstallTrigger is deprecated and will be removed in the future HOT 1
- Is this repo unmaintained?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from favico.js.