Skip to content

Commit

Permalink
fix(mobile): multiwallet & onboarding fixes (#753)
Browse files Browse the repository at this point in the history
* fix(mobile): migration button ru locale

* fix(mobile): Input leftContent

* fix(mobile): fix enableNotificationsForAll

* fix(mobile): fix toggle dapp notifications
  • Loading branch information
sorokin0andrey authored Mar 7, 2024
1 parent 663c006 commit afcc7bd
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export const SetupNotifications: React.FC<Props> = (props) => {
setLoading(true);

if (identifiers.length > 1) {
await Promise.race([tk.enableNotificationsForAll(identifiers), delay(5000)]);
await Promise.race([tk.enableNotificationsForAll(identifiers), delay(10000)]);
} else {
await Promise.race([tk.wallet.notifications.subscribe(), delay(5000)]);
await Promise.race([tk.wallet.notifications.subscribe(), delay(10000)]);
}

handleDone();
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/src/uikit/SwitchItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface SwitchItemProps {
export const SwitchItem: React.FC<SwitchItemProps> = (props) => {
const { icon, title, onChange, value, disabled, subtitle } = props;

const handleToggle = React.useCallback(() => onChange(!value), [value]);
const handleToggle = React.useCallback(() => onChange(!value), [onChange, value]);

return (
<Highlight onPress={handleToggle} style={styles.container} isDisabled={disabled}>
Expand Down
12 changes: 4 additions & 8 deletions packages/mobile/src/wallet/Tonkeeper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,10 @@ export class Tonkeeper {
}

public async enableNotificationsForAll(identifiers: string[]) {
await Promise.all(
identifiers.map(async (identifier) => {
const wallet = this.wallets.get(identifier);
if (wallet) {
await wallet.notifications.subscribe();
}
}),
);
for (const identifier of identifiers) {
const wallet = this.wallets.get(identifier)!;
await wallet.notifications.subscribe();
}
}

public getWalletByAddress(address: string) {
Expand Down
22 changes: 12 additions & 10 deletions packages/shared/components/InputNumberPrefix.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { Text, isAndroid } from '@tonkeeper/uikit';
import { Steezy, Text, View, isAndroid } from '@tonkeeper/uikit';
import { StyleSheet } from 'react-native';

export const InputNumberPrefix = ({ index }: { index: number }) => (
<Text style={styles.inputNumberText} color="textSecondary" type="body1">
{index + 1}:
</Text>
<View style={styles.container}>
<Text color="textSecondary" type="body1" textAlign="right">
{index + 1}:
</Text>
</View>
);

const styles = StyleSheet.create({
inputNumberText: {
textAlignVertical: isAndroid ? 'top' : 'auto',
textAlign: 'right',
width: 28,
left: 10,
const styles = Steezy.create({
container: {
flex: 1,
width: 50,
paddingRight: 12,
justifyContent: 'center',
},
});
4 changes: 2 additions & 2 deletions packages/shared/i18n/locales/tonkeeper/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@
"face_recognition_instrumental" : "распознаванием лица",
"fingerprint" : "отпечаток пальца",
"fingerprint_genitive" : "отпечатка пальца",
"fingerprint_instrumental" : "отпечатком пальца"
"fingerprint_instrumental" : "отпечатком"
},
"ios" : {
"face_recognition" : "Face ID",
Expand Down Expand Up @@ -1215,7 +1215,7 @@
"use_biometry": "Включите %{name} для подтверждения транзакций",
"enable_notifications": "Включите уведомления о транзакциях",
"backup": "Создайте резервную копию секретного ключа кошелька",
"done_buttom": "Done"
"done_buttom": "Готово"
},
"buy_ton": {
"title": "Купить TON",
Expand Down
5 changes: 3 additions & 2 deletions packages/uikit/src/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,10 @@ const styles = Steezy.create(({ colors, corners }) => ({
? inputPaddings.withoutLabel.android
: inputPaddings.withoutLabel.other,
leftContent: {
paddingTop: 16 - InputBorderWidth,
top: 0,
left: 0,
bottom: 0,
position: 'absolute',
top: isAndroid ? 1 : 0,
},
invalidBg: {
position: 'absolute',
Expand Down

0 comments on commit afcc7bd

Please sign in to comment.