Skip to content

Commit

Permalink
Reduce settings notifications when saving toggled settings
Browse files Browse the repository at this point in the history
  • Loading branch information
InternalError503 committed Nov 16, 2017
1 parent 7b3c3a0 commit b93bdab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
THE SOFTWARE.
*/
var forgetitoptions = {
var notifyCount = 0, // limit notifications
forgetitoptions = {

//Load up localised content
init: function() {
Expand Down Expand Up @@ -257,6 +258,13 @@
},

sendNotification : function (aType, aMessage, aIcon, aUseIcon){
notifyCount++;
if (notifyCount >= 2 ){
setTimeout(function() {
notifyCount = 0;
}, 2000);
return;
} //Reduced notification span, not optimal solution
if (aUseIcon === true){
UIkit.notify(aIcon + " "+ aMessage, {status:aType, timeout : 1000, pos:'bottom-right'});
}else{
Expand Down

0 comments on commit b93bdab

Please sign in to comment.