Reset last_pos when moving to next utterance

This commit is contained in:
Kovid Goyal 2024-11-05 08:20:46 +05:30
parent 0b2fe9d569
commit eb6d2d8636
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 0 deletions

View File

@ -69,6 +69,9 @@ class Tracker:
def pop_first(self) -> bool: def pop_first(self) -> bool:
if self.queue: if self.queue:
self.queue.popleft() self.queue.popleft()
self.last_pos = 0
if self.queue:
self.last_pos = self.queue[0].index_in_positions
return True return True
return False return False

View File

@ -52,6 +52,9 @@ class Tracker:
def pop_first(self): def pop_first(self):
self.queue.splice(0, 1) self.queue.splice(0, 1)
self.last_pos = 0
if self.queue.length:
self.last_pos = self.queue[0].index_in_positions
def current_text(self): def current_text(self):
if self.queue.length: if self.queue.length: