Clear message buffers when macro was paused

This commit is contained in:
WarmUpTill
2024-02-21 21:14:02 +01:00
committed by WarmUpTill
parent cf97c1f60b
commit 1be72218a9
6 changed files with 48 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
#include "macro-condition-websocket.hpp"
#include "layout-helpers.hpp"
#include "macro-helpers.hpp"
#include <regex>
@@ -32,6 +33,14 @@ bool MacroConditionWebsocket::CheckCondition()
return false;
}
const bool macroWasPausedSinceLastCheck =
MacroWasPausedSince(GetMacro(), _lastCheck);
_lastCheck = std::chrono::high_resolution_clock::now();
if (macroWasPausedSinceLastCheck) {
_messageBuffer->Clear();
return false;
}
while (!_messageBuffer->Empty()) {
auto message = _messageBuffer->ConsumeMessage();
if (!message) {