Greetings for my first post here. I've been struggling with an issue in a personal project lately. I remember coming across a similar topic on this forum before, but now I can't seem to find it. As far as I recall, the question went unanswered.
I must confess that my title might be a bit unconventional, but I couldn't think of a better way to explain it. Anyways, let's delve into it.
So, there's this function:
(url and time values are correctly provided, so that's not the problem)
function setTimer(url, time) {
var timeHR = time / 1000 / 60;
idTimerString = saveTimer(url, timeHR);
console.log(idTimerString);
setTimeout(function() {
var options = {
type: "basic",
title: "Remind me later !",
message: ('You asked me to remind you :\n' + url + ' \n' + timeHR + ' minutes ago. Click to open it !'),
iconUrl: 'img/icon.png'
}
chrome.notifications.create(idTimerString, options, function(cb) {
console.log(cb);
});
}, time);
}
Everything works fine when this function is called once; the notification displays correctly after the designated time. However, if I make one call for 30 minutes (id = 1) and then another right after for 60 minutes (id = 2), clicking the first notification gives me id 2, and the same happens for the second notification. I was expecting to get ids 1 and 2 sequentially. Have any insights on why this might be happening?
My extension is already live if you'd like to test the bug, but I worry it might come off as advertising.