Make sure alarms aren't on with app being optimized
If battery optimizations are on for the app, alarms will have several unpredictable bugs. For example, sometimes sounds won't play, sometimes re focuisng the app won't work.
This commit is contained in:
parent
2c6a773548
commit
d6e7d6158c
|
@ -58,9 +58,12 @@ export default function SettingsPage() {
|
||||||
setDate(settings.date)
|
setDate(settings.date)
|
||||||
setShowDate(settings.showDate)
|
setShowDate(settings.showDate)
|
||||||
setNoSound(settings.noSound)
|
setNoSound(settings.noSound)
|
||||||
|
if (Platform.OS !== 'android') return
|
||||||
|
NativeModules.SettingsModule.ignoringBattery((isIgnoring: boolean) => {
|
||||||
|
if (!isIgnoring && settings.alarm) setAlarm(false)
|
||||||
|
setIgnoring(isIgnoring)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
if (Platform.OS !== 'android') return
|
|
||||||
NativeModules.SettingsModule.ignoringBattery(setIgnoring)
|
|
||||||
NativeModules.SettingsModule.is24().then((is24: boolean) => {
|
NativeModules.SettingsModule.is24().then((is24: boolean) => {
|
||||||
console.log(`${SettingsPage.name}.focus:`, {is24})
|
console.log(`${SettingsPage.name}.focus:`, {is24})
|
||||||
if (is24) setFormatOptions(['P', 'P, k:m', 'ccc k:m', 'k:m'])
|
if (is24) setFormatOptions(['P', 'P, k:m', 'ccc k:m', 'k:m'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user