Skip to content

Commit

Permalink
Fix go back in setup on macOS (fixes #43)
Browse files Browse the repository at this point in the history
  • Loading branch information
knutkirkhorn committed Aug 8, 2023
1 parent 7ae3906 commit f23f33d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/components/SetupCredentials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type SelectInputItem = {
value: string;
};

const isMacOs = process.platform === 'darwin';

export default function SetupCredentials({onComplete, defaultCredentials}: Properties) {
const [vpnServer, setVpnServer] = useState('');
const [group, setGroup] = useState<SelectInputItem>({label: '', value: ''});
Expand Down Expand Up @@ -88,7 +90,10 @@ export default function SetupCredentials({onComplete, defaultCredentials}: Prope
};

useInput((_input, key) => {
if (key.backspace && step >= STEPS.GROUP) {
const hasPressedBackspace = key.backspace || (isMacOs && key.delete);
const canGoBack = step > STEPS.VPN_SERVER;

if (hasPressedBackspace && canGoBack) {
goToPreviousStep();
}
});
Expand Down

0 comments on commit f23f33d

Please sign in to comment.