Fix buzz.js - whenever called this used to keep firing an interval every 100ms, and they would build up!

pull/2801/head
Gordon Williams 2023-06-08 19:26:12 +01:00
parent a299ac1c58
commit 2b6f7765cc
3 changed files with 3 additions and 2 deletions

View File

@ -3,3 +3,4 @@
0.57: Optimize saving empty message list 0.57: Optimize saving empty message list
0.58: show/hide "messages" widget directly, instead of through library stub 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. 0.59: fixes message timeout by using setinterval, as it was intended. So the buzz is triggered every x seconds until the timeout occours.
0.60: Bump version to allow new buzz.js module to be loaded - fixes memory/performance hog when buzz called

View File

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

View File

@ -16,7 +16,7 @@
*/ */
exports.pattern = pattern => new Promise(resolve => { exports.pattern = pattern => new Promise(resolve => {
function doBuzz() { function doBuzz() {
if (pattern == "") resolve(); if (pattern == "") return resolve();
var c = pattern[0]; var c = pattern[0];
pattern = pattern.substr(1); pattern = pattern.substr(1);
const BUZZ_WEAK = 0.25, BUZZ_STRONG = 1; const BUZZ_WEAK = 0.25, BUZZ_STRONG = 1;