mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Fix changeCounterValue() not considering initial value
If a counter was initialized via the INSERT in changeCounterValue(), its value would be set to the change value rather than the specified initial value. For example, a counter with an initial value of 1000 and a change of 5 would get initialized to 5, not 1005.
This commit is contained in:
parent
49577e37ca
commit
31d7748bf4
2 changed files with 9 additions and 3 deletions
|
@ -31,7 +31,7 @@ export async function changeCounterValue(
|
|||
const counterId = pluginData.state.counterIds[counterName];
|
||||
const lock = await pluginData.locks.acquire(counterIdLock(counterId));
|
||||
|
||||
await pluginData.state.counters.changeCounterValue(counterId, channelId, userId, change);
|
||||
await pluginData.state.counters.changeCounterValue(counterId, channelId, userId, change, counter.initial_value);
|
||||
|
||||
// Check for trigger matches, if any, when the counter value changes
|
||||
const triggers = pluginData.state.counterTriggersByCounterId.get(counterId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue