diff options
author | Paul Frazee <pfrazee@gmail.com> | 2024-02-06 12:14:27 -0800 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2024-02-06 12:14:27 -0800 |
commit | 2d13f3b3676e42c233e9a1a6436ca7c55ec6388d (patch) | |
tree | 4ce1b85ca370c0e68af146af74fa5f4ad337a67d /src | |
parent | ec86282403ea34704d0faab7b04ca033bd3a0650 (diff) | |
parent | d38583781200437b1a01f8a016694c4a8d036aad (diff) | |
download | voidsky-2d13f3b3676e42c233e9a1a6436ca7c55ec6388d.tar.zst |
Merge branch 'mary-ext-fix/app-password-submit' into main
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/modals/AddAppPasswords.tsx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/view/com/modals/AddAppPasswords.tsx b/src/view/com/modals/AddAppPasswords.tsx index 5048a0041..a8913dd54 100644 --- a/src/view/com/modals/AddAppPasswords.tsx +++ b/src/view/com/modals/AddAppPasswords.tsx @@ -62,7 +62,8 @@ export function Component({}: {}) { const {_} = useLingui() const {closeModal} = useModalControls() const {data: passwords} = useAppPasswordsQuery() - const createMutation = useAppPasswordCreateMutation() + const {mutateAsync: mutateAppPassword, isPending} = + useAppPasswordCreateMutation() const [name, setName] = useState( shadesOfBlue[Math.floor(Math.random() * shadesOfBlue.length)], ) @@ -107,7 +108,7 @@ export function Component({}: {}) { } try { - const newPassword = await createMutation.mutateAsync({name}) + const newPassword = await mutateAppPassword({name}) if (newPassword) { setAppPassword(newPassword.password) } else { @@ -170,13 +171,10 @@ export function Component({}: {}) { autoFocus={true} maxLength={32} selectTextOnFocus={true} - multiline={true} // need this to be true otherwise selectTextOnFocus doesn't work - numberOfLines={1} // hack for multiline so only one line shows (android) - scrollEnabled={false} // hack for multiline so only one line shows (ios) - blurOnSubmit={true} // hack for multiline so it submits - editable={!appPassword} + blurOnSubmit={true} + editable={!isPending} returnKeyType="done" - onEndEditing={createAppPassword} + onSubmitEditing={createAppPassword} accessible={true} accessibilityLabel={_(msg`Name`)} accessibilityHint={_(msg`Input name for app password`)} @@ -253,7 +251,6 @@ const styles = StyleSheet.create({ width: '100%', paddingVertical: 10, paddingHorizontal: 8, - marginTop: 6, fontSize: 17, letterSpacing: 0.25, fontWeight: '400', |