Skip to content

Commit 3df424b

Browse files
author
thyttan
committed
spotrem: refactor moving buzzes to callback function
1 parent 0b693cd commit 3df424b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

apps/spotrem/app.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ let knobTimeout;
104104
let dragHandler = function(e) {
105105

106106
let cb = ud => {
107-
if (ud) Bangle.musicControl(ud<0 ? "volumedown" : "volumeup");
107+
Bangle.musicControl(ud<0 ? "volumedown" : "volumeup");
108+
Bangle.buzz(20);
108109
}
109110

110111
let resetOuterScopeVariables = ()=>{
@@ -121,7 +122,6 @@ let dragHandler = function(e) {
121122
if (dy>0) { dy-=32; cb(-1) }
122123
else { dy+=32; cb(1) }
123124
volumeChangedThisGoAround = true;
124-
Bangle.buzz(20);
125125
}
126126

127127
if (volumeChangedThisGoAround && Math.abs(dx)>32) {
@@ -211,7 +211,6 @@ let dial = function(cb, options) {
211211
}
212212

213213
function stepHandler(step) {
214-
Bangle.buzz(20, 0.8);
215214
cumulative -= THRESHOLD * step;
216215
cb(step);
217216
}

0 commit comments

Comments
 (0)