Skip to content

Commit 0d64ad2

Browse files
committed
feat: Add link to Battery Settings
Make it easier for users to grant background permissions for the app.
1 parent e96d966 commit 0d64ad2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ui/ManualSync.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
33
import Button from '@components/Button';
44
import Dialog from '@components/Dialog';
55
import Text from '@components/Text';
6-
import { View } from 'react-native';
6+
import { Linking, View } from 'react-native';
77

88
const runSync = require('../tasks/TodoistHabitSync');
99

@@ -43,6 +43,7 @@ function SyncDialog({ visible, onDismiss }: SyncDialogProps) {
4343
actions={
4444
<Dialog.Actions>
4545
<Button onPress={onDismiss}>Cancel</Button>
46+
<Button mode="tonal" onPress={() => Linking.sendIntent("android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS")}>Battery Settings</Button>
4647
<Button mode="contained" onPress={() => { runSync(); onDismiss(); }}>Run Sync</Button>
4748
</Dialog.Actions>
4849
}

0 commit comments

Comments
 (0)