Skip to content

Commit

Permalink
fix: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
SputNikPlop committed Aug 21, 2024
1 parent 7c252ad commit 9570ae0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
if (model.sources.isEmpty || (await AudioChannel.hasPermission())) {
return;
}

if (mounted) {
debugPrint("Conditions passed");
model.showAudioPermissionDialog(context);
checkAndHandleBatteryLevel(ttsModel);
}
});
}
Expand All @@ -201,7 +202,10 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {

if (batteryLevel < 5 && !isCharging) {
if (model.enabled) {
model.enabled = false;
if (mounted) {
model.setEnabled(AppLocalizations.of(context)!, false);
}

updateChannelSubscription("");
await TextToSpeechPlugin.speak("Text to speech disabled");
await TextToSpeechPlugin.disableTTS();
Expand All @@ -214,10 +218,6 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
void dispose() {
WakelockPlus.disable();
super.dispose();

if (_batteryStateSubscription != null) {
_batteryStateSubscription!.cancel();
}
}

@override
Expand Down

0 comments on commit 9570ae0

Please sign in to comment.