Skip to content

Commit

Permalink
fix (#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
RustemYuzlibaev authored Feb 18, 2023
1 parent 5642a12 commit 3b85b8d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/components/SoraCard/steps/KycView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export default class KycView extends Mixins(TranslationMixin) {
const referenceNumber = await this.getReferenceNumber(soraProxy.referenceNumberEndpoint);
await unloadScript(kycService.sdkURL).catch(() => {});
loadScript(kycService.sdkURL)
.then(() => {
// @ts-expect-error no-undef
Expand Down
16 changes: 12 additions & 4 deletions src/components/SoraCard/steps/Phone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,16 @@ export default class Phone extends Mixins(TranslationMixin, mixins.LoadingMixin)
this.smsResendText = `RESEND IN 0:${countDown}`;
}
verifyCode(): void {
// TODO: check for length before sending
@Watch('isEuroBalanceEnough', { immediate: true })
private handleXorDeposit(isEnough: boolean): void {
if (isEnough) {
this.notPassedKycAndNotHasXorEnough = false;
this.verificationCode = '';
this.smsSent = false;
}
}
verifyCode(): void {
this.authLogin.PayWingsOtpCredentialVerification(this.verificationCode).catch((error) => {
this.sendOtpBtnLoading = false;
this.verificationCode = '';
Expand All @@ -109,7 +116,7 @@ export default class Phone extends Mixins(TranslationMixin, mixins.LoadingMixin)
type: 'error',
title: '',
});
console.error(error);
console.error('[SoraCard]: Auth', error);
});
this.sendOtpBtnLoading = true;
Expand All @@ -119,7 +126,7 @@ export default class Phone extends Mixins(TranslationMixin, mixins.LoadingMixin)
this.authLogin
.PayWingsSendOtp(`${this.countryCode}${this.phoneNumber}`, 'Your verification code is: @Otp')
.catch((error) => {
console.error(error);
console.error('[SoraCard]: Auth', error);
});
this.startSmsCountDown();
Expand Down Expand Up @@ -213,6 +220,7 @@ export default class Phone extends Mixins(TranslationMixin, mixins.LoadingMixin)
if (this.smsResendCount < 0) {
this.smsSent = false;
this.verificationCode = '';
this.smsResendCount = RESEND_INTERVAL;
clearInterval(interval);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/SoraCard/steps/RoadMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default class RoadMap extends Mixins(TranslationMixin, mixins.LoadingMixi
if (!mediaDevicesAllowance) return;
} catch (error) {
console.error('[KYC Sora Card]: Camera error.', error);
console.error('[SoraCard]: Camera error.', error);
}
this.$emit('confirm');
Expand Down
6 changes: 5 additions & 1 deletion src/store/soraCard/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { waitForAccountPair } from '@/utils';
import { defineUserStatus, getXorPerEuroRatio, soraCard } from '@/utils/card';
import { soraCardActionContext } from './../soraCard';
import { Status } from '@/types/card';
import { loadScript } from 'vue-plugin-load-script';
import { loadScript, unloadScript } from 'vue-plugin-load-script';

const actions = defineActions({
calculateXorRestPrice(context, xorPerEuro: FPNumber): void {
Expand Down Expand Up @@ -75,6 +75,10 @@ const actions = defineActions({
const soraNetwork = rootState.wallet.settings.soraNetwork || WALLET_CONSTS.SoraNetwork.Test;
const { authService } = soraCard(soraNetwork);

await unloadScript(authService.sdkURL).catch(() => {
/* no need to handle */
});

await loadScript(authService.sdkURL).then(() => {
// TODO: annotate via TS main calls
// @ts-expect-error no undefined
Expand Down

0 comments on commit 3b85b8d

Please sign in to comment.