diff --git a/src/app/components/info-sheet/info-sheet.html b/src/app/components/info-sheet/info-sheet.html index d01a124b58..0a6bd8b0fe 100644 --- a/src/app/components/info-sheet/info-sheet.html +++ b/src/app/components/info-sheet/info-sheet.html @@ -290,8 +290,8 @@ GOT IT - - Error + + Warning The account you are using does not match the network and/or the currency of the address provided diff --git a/src/app/pages/accounts/accounts.html b/src/app/pages/accounts/accounts.html index 73f0066b04..1a54b71371 100644 --- a/src/app/pages/accounts/accounts.html +++ b/src/app/pages/accounts/accounts.html @@ -134,7 +134,8 @@ -
+ + \ No newline at end of file diff --git a/src/app/pages/accounts/accounts.ts b/src/app/pages/accounts/accounts.ts index ef88f0fb86..251241a92d 100644 --- a/src/app/pages/accounts/accounts.ts +++ b/src/app/pages/accounts/accounts.ts @@ -169,6 +169,10 @@ export class AccountsPage { // Only 1 token account in list => go to send page if (this.isSpecificAmount && tokensGroups.length === 0) { this.isShowNoToken = true; + this.router.navigate(['']).then(() => { + const warningSheet = this.actionSheetProvider.createInfoSheet('scan-eToken-error-message'); + warningSheet.present(); + }); } else if (this.isSpecificAmount && tokensGroups.length === 1) { this.goToSendPageForToken(tokensGroups[0].walletId, tokensGroups[0], true); } @@ -187,6 +191,10 @@ export class AccountsPage { // Check ExistToken if (tokensGroups.length === 0) { this.isShowNoToken = true; + this.router.navigate(['']).then(() => { + const warningSheet = this.actionSheetProvider.createInfoSheet('scan-eToken-error-message'); + warningSheet.present(); + }); } } diff --git a/src/app/providers/push-notifications/push-notifications.ts b/src/app/providers/push-notifications/push-notifications.ts index 6c92249067..58f3b38273 100644 --- a/src/app/providers/push-notifications/push-notifications.ts +++ b/src/app/providers/push-notifications/push-notifications.ts @@ -2,7 +2,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { timer } from 'rxjs'; -import { FCM } from "@capacitor-community/fcm"; +import { FCM } from '@capacitor-community/fcm'; // providers import { AppProvider } from '../app/app'; @@ -69,12 +69,12 @@ export class PushNotificationsProvider { this.appProvider.info.name != 'copay' && config.offersAndPromotions.enabled ) - await this.subscribeToTopic('offersandpromotions'); + await this.subscribeToTopic('offersandpromotions'); if ( this.appProvider.info.name != 'copay' && config.productsUpdates.enabled ) - await this.subscribeToTopic('productsupdates'); + await this.subscribeToTopic('productsupdates'); this.fcmInterval = setInterval(() => { this.renewSubscription(); @@ -82,17 +82,20 @@ export class PushNotificationsProvider { }); // Show us the notification payload if the app is open on our device - PushNotifications.addListener('pushNotificationReceived', + PushNotifications.addListener( + 'pushNotificationReceived', (notification: PushNotificationSchema) => { return this.handlePushNotifications(notification); } ); // Method called when tapping on a notification - PushNotifications.addListener('pushNotificationActionPerformed', + PushNotifications.addListener( + 'pushNotificationActionPerformed', async (notification: ActionPerformed) => { return await this.handlePushNotificationsWasTapped(notification); - }); + } + ); } private async getToken() { @@ -104,23 +107,26 @@ export class PushNotificationsProvider { }, 5000); return; } - this.logger.debug('Get token for push notifications android: ' + value); - this._token = value; - }) + this.logger.debug('Get token for push notifications android: ' + value); + this._token = value; + }); } else { FCM.getToken() - .then(async token => { - if (!token) { - setTimeout(() => { - this.init(); - }, 5000); - return; - } - this.logger.debug('Get token for push notifications ios: ' + token.token); + .then(async token => { + if (!token) { + setTimeout(() => { + this.init(); + }, 5000); + return; + } + this.logger.debug( + 'Get token for push notifications ios: ' + token.token + ); this._token = token.token; - }).catch(error=>{ - this.logger.error(error); - }); + }) + .catch(error => { + this.logger.error(error); + }); } } @@ -154,36 +160,36 @@ export class PushNotificationsProvider { // Notification was received on device tray and tapped by the user. public handlePushNotificationsWasTapped(notification: ActionPerformed): void { if (this.usePushNotifications) { - if (!this._token) return; + if (!this._token) return; const data = _.get(notification, 'notification.data', undefined); if (!data) return; - if (data.redir) { - this.events.publish('IncomingDataRedir', { name: data.redir }); - } else if ( - data.takeover_url && - data.takeover_image && - data.takeover_sig - ) { - if (!this.verifySignature(data)) return; - this.events.publish('ShowAdvertising', data); - } else { - this._openWallet(data); - } + if (data.redir) { + this.events.publish('IncomingDataRedir', { name: data.redir }); + } else if ( + data.takeover_url && + data.takeover_image && + data.takeover_sig + ) { + if (!this.verifySignature(data)) return; + this.events.publish('ShowAdvertising', data); + } else { + this._openWallet(data); + } } } public handlePushNotifications(notification: PushNotificationSchema): void { if (this.usePushNotifications) { if (!this._token) return; - const data = notification.data + const data = notification.data; this.logger.debug( 'New Event Push onNotification: ' + JSON.stringify(data) ); - const wallet = this.findWallet(data.walletId, data.tokenAddress); - if (!wallet) return; - this.newBwsEvent(data, wallet.credentials.walletId); - this.showInappNotification(data); - } + const wallet = this.findWallet(data.walletId, data.tokenAddress); + if (!wallet) return; + this.newBwsEvent(data, wallet.credentials.walletId); + this.showInappNotification(data); + } } public newBwsEvent(notification, walletId): void { @@ -396,8 +402,7 @@ export class PushNotificationsProvider { if (!data.body || data.notification_type === 'NewOutgoingTx') return; this.notifications.unshift(data); - // TODO: Tempory disable notification in-app - // this.runNotificationsQueue(); + this.runNotificationsQueue(); } private runNotificationsQueue() { @@ -422,12 +427,12 @@ export class PushNotificationsProvider { cssClass: 'in-app-notification-modal' }); this.currentNotif.onDidDismiss().then(({ data }) => { - if (data && data.action && data.action === 'openWallet') { + if (data && data.action && data.action === 'openWallet') { this._openWallet(data); } this.currentNotif = null; this.runNotificationsQueue(); - }) + }); await this.currentNotif.present(); data.showDone = true; diff --git a/src/assets/i18n/vi.po b/src/assets/i18n/vi.po index 7b0e3873a0..26113f5480 100644 --- a/src/assets/i18n/vi.po +++ b/src/assets/i18n/vi.po @@ -3592,7 +3592,7 @@ msgid "Sending transaction..." msgstr "Đang gửi giao dịch..." msgid "Sending {{amount}} {{unit}} from your {{name}} account" -msgstr "Đang gửi {{amount}} {{unit}} từ ví {{name}} của bạn" +msgstr "Đang gửi {{amount}} {{unit}} từ tài khoản {{name}} của bạn" msgid "Sensitive Data" msgstr "Sensitive Data"