diff --git a/src/MessageStore.cpp b/src/MessageStore.cpp index 3c0eb2691..1cb5ca855 100644 --- a/src/MessageStore.cpp +++ b/src/MessageStore.cpp @@ -91,7 +91,7 @@ void MessageStore::saveToFlash() f.write((uint8_t *)&m.sender, sizeof(m.sender)); f.write((uint8_t *)&m.channelIndex, sizeof(m.channelIndex)); f.write((uint8_t *)&m.dest, sizeof(m.dest)); - f.write((uint8_t *)m.text.c_str(), std::min(MAX_MESSAGE_SIZE, (uint32_t)m.text.size())); + f.write((uint8_t *)m.text.c_str(), std::min(static_cast(MAX_MESSAGE_SIZE), m.text.size())); f.write('\0'); // null terminator } spiLock->unlock(); @@ -211,4 +211,4 @@ std::deque MessageStore::getDirectMessages() const } // === Global definition === -MessageStore messageStore("default"); \ No newline at end of file +MessageStore messageStore("default"); diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 35ab4b34f..c300cd227 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1374,6 +1374,9 @@ void Screen::handleShowPrevFrame() ui->previousFrame(); lastScreenTransition = millis(); setFastFramerate(); + + // Reset scroll state if we’re leaving the text message frame + graphics::MessageRenderer::resetScrollState(); } } @@ -1385,6 +1388,9 @@ void Screen::handleShowNextFrame() ui->nextFrame(); lastScreenTransition = millis(); setFastFramerate(); + + // Reset scroll state if we’re leaving the text message frame + graphics::MessageRenderer::resetScrollState(); } }