Skip to content

Commit

Permalink
Set default screen lock timeout to 60 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpyneDreams committed Jul 31, 2022
1 parent 1a0721a commit 8f9959a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions screens/ScreenLockSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ function AutoLockSettings({enabled, value, onChange}) {

let description = 'Lock screen after a period of inactivity'
if (value > 0) {
description = `Lock screen after ${dayjs.duration(value).humanize()} of inactivity`
description = `Lock screen after ${value < 60000 ? `${value / 1000} seconds` : dayjs.duration(value).humanize()} of inactivity`
} else if (value === 0) {
description = 'Lock screen immediately when inactive'
} else if (value < 0) {
description = `Off`
description = `Screen will not be locked automatically`
}

return (<>
Expand All @@ -130,13 +130,18 @@ function AutoLockSettings({enabled, value, onChange}) {
onPress={() => showPicker(true)}
/>
<ChooseDialog
title='Auto-lock'
title='Auto-lock timeout'
state={[picker, showPicker]}
options={{
'Immediately': 0,
'5 seconds': 5 * 1000,
'15 seconds': 15 * 1000,
'30 seconds': 30 * 1000,
'1 minute': 1 * 1000 * 60,
'2 minutes': 2 * 1000 * 60,
'5 minutes': 5 * 1000 * 60,
'1 hour': 60 * 1000 * 60,
'10 minutes': 10 * 1000 * 60,
'30 minutes': 30 * 1000 * 60,
'Off': -1,
}}
value={value} onChange={onChange}
Expand Down
2 changes: 1 addition & 1 deletion store/UserData.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const defaultUserData = {
darkTheme: null,
dataSource: 'psychonaut', // 'tripsit' or 'psychonaut'
screenLock: false,
autoLock: 5000,
autoLock: 60000,
compactDoseCards: false,
},
recentSubstances: [],
Expand Down

0 comments on commit 8f9959a

Please sign in to comment.