Reset invalid log-reading position.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
bc24308fa1
commit
66dcd7cb00
|
@ -43,6 +43,9 @@ fn read_log(
|
|||
log: Query<&Log, Changed<Log>>,
|
||||
) -> Result<(), Box<dyn Error>> {
|
||||
for log in log.iter() {
|
||||
if *position >= log.len() {
|
||||
*position = 0;
|
||||
}
|
||||
for (index, entry) in log.iter().enumerate() {
|
||||
if index >= *position {
|
||||
tts.speak(entry.message.clone(), false)?;
|
||||
|
|
Loading…
Reference in New Issue
Block a user