1
0
Fork 0

Merge pull request #2741 from targor/master

Buzzing behavior in message app
master
Gordon Williams 2023-05-11 13:57:06 +01:00 committed by GitHub
commit 419d734043
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -2,3 +2,4 @@
0.56: Fix handling of music messages
0.57: Optimize saving empty message list
0.58: show/hide "messages" widget directly, instead of through library stub
0.59: fixes message timeout by using setinterval, as it was intended. So the buzz is triggered every x seconds until the timeout occours.

View File

@ -215,8 +215,9 @@ exports.buzz = function(msgSrc) {
let repeat = msgSettings.repeat;
if (repeat===undefined) repeat = 4; // repeat may be zero
if (repeat) {
exports.buzzTimeout = setTimeout(() => require("buzz").pattern(pattern), repeat*1000);
if (repeat)
{
exports.buzzInterval = setInterval(() => require("buzz").pattern(pattern), repeat*1000);
let vibrateTimeout = msgSettings.vibrateTimeout;
if (vibrateTimeout===undefined) vibrateTimeout = 60;
if (vibrateTimeout && !exports.stopTimeout) exports.stopTimeout = setTimeout(exports.stopBuzz, vibrateTimeout*1000);
@ -227,8 +228,8 @@ exports.buzz = function(msgSrc) {
* Stop buzzing
*/
exports.stopBuzz = function() {
if (exports.buzzTimeout) clearTimeout(exports.buzzTimeout);
delete exports.buzzTimeout;
if (exports.buzzInterval) clearInterval(exports.buzzInterval);
delete exports.buzzInterval;
if (exports.stopTimeout) clearTimeout(exports.stopTimeout);
delete exports.stopTimeout;
};

View File

@ -1,7 +1,7 @@
{
"id": "messages",
"name": "Messages",
"version": "0.58",
"version": "0.59",
"description": "Library to handle, load and store message events received from Android/iOS",
"icon": "app.png",
"type": "module",