Skip to content

Commit

Permalink
fix: aliasname bug
Browse files Browse the repository at this point in the history
  • Loading branch information
heisenberg-2077 committed Dec 2, 2024
1 parent a6b1912 commit 753478d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 1 addition & 2 deletions apps/mobile/src/screens/Address/AddressListScreenButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ export const AddressListScreenButton: React.FC<Props> = ({
disableAutoFetch: true,
});
const maxHeight = Dimensions.get('window').height - 104;
const contentHeight =
accounts.length * (94 + 12) + (IS_ANDROID ? 60 + 56 : 0);
const contentHeight = accounts.length * (94 + 12) + 60 + 56;

const onPress = React.useCallback(() => {
const id = createGlobalBottomSheetModal2024({
Expand Down
11 changes: 9 additions & 2 deletions apps/mobile/src/screens/Address/ImportSuccessScreen2024.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,17 @@ export const ImportSuccessScreen2024 = () => {
disableAutoFetch: true,
});

const handleDone = React.useCallback(() => {
const saveFirstAddressAlias = React.useCallback(() => {
importAddresses.forEach(item => {
contactService.setAlias({
address: item.address,
alias: item.aliasName || ellipsisAddress(item.address), // for empty inputText
});
});
}, [importAddresses]);

const handleDone = React.useCallback(() => {
saveFirstAddressAlias();
Keyboard.dismiss();

navigation.reset({
Expand All @@ -115,7 +119,7 @@ export const ImportSuccessScreen2024 = () => {
},
],
});
}, [importAddresses, navigation]);
}, [navigation, saveFirstAddressAlias]);

const isFocus = useIsFocused();

Expand Down Expand Up @@ -189,6 +193,9 @@ export const ImportSuccessScreen2024 = () => {
if (modalRef.current) {
return;
}

saveFirstAddressAlias();

modalRef.current = createGlobalBottomSheetModal2024({
name: MODAL_NAMES.IMPORT_MORE_ADDRESS,
params: {
Expand Down

0 comments on commit 753478d

Please sign in to comment.