always cancel screenshot timers
This commit is contained in:
+2
@@ -148,6 +148,7 @@ class _BrowserViewState extends ConsumerState<BrowserView>
|
|||||||
if (next.isLoading == false &&
|
if (next.isLoading == false &&
|
||||||
(_periodicScreenshotUpdate?.isActive ?? false) == false) {
|
(_periodicScreenshotUpdate?.isActive ?? false) == false) {
|
||||||
_timerPaused = false;
|
_timerPaused = false;
|
||||||
|
_periodicScreenshotUpdate?.cancel();
|
||||||
_periodicScreenshotUpdate = Timer.periodic(
|
_periodicScreenshotUpdate = Timer.periodic(
|
||||||
widget.screenshotPeriod,
|
widget.screenshotPeriod,
|
||||||
_timerTick,
|
_timerTick,
|
||||||
@@ -475,6 +476,7 @@ class _BrowserViewState extends ConsumerState<BrowserView>
|
|||||||
}
|
}
|
||||||
case AppLifecycleState.resumed:
|
case AppLifecycleState.resumed:
|
||||||
if (_timerPaused) {
|
if (_timerPaused) {
|
||||||
|
_periodicScreenshotUpdate?.cancel();
|
||||||
_periodicScreenshotUpdate = Timer.periodic(
|
_periodicScreenshotUpdate = Timer.periodic(
|
||||||
widget.screenshotPeriod,
|
widget.screenshotPeriod,
|
||||||
_timerTick,
|
_timerTick,
|
||||||
|
|||||||
Reference in New Issue
Block a user