Expand AITURK Turkish settings and desktop surfaces for beta 5
This commit is contained in:
@@ -5,6 +5,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { $gateway } from '@/store/gateway'
|
||||
|
||||
import { useBillingApi } from './api'
|
||||
import { useBillingCopy } from './copy'
|
||||
import { resolveRefusal } from './errors'
|
||||
|
||||
export type StepUpPhase = 'idle' | 'verifying' | 'waiting'
|
||||
@@ -26,6 +27,7 @@ interface StepUpVerificationPayload {
|
||||
}
|
||||
|
||||
export function useStepUpFlow() {
|
||||
const copy = useBillingCopy()
|
||||
const api = useBillingApi()
|
||||
const gateway = useStore($gateway)
|
||||
const queryClient = useQueryClient()
|
||||
@@ -107,7 +109,7 @@ export function useStepUpFlow() {
|
||||
unsubscribe()
|
||||
|
||||
if (!result.ok) {
|
||||
const resolved = resolveRefusal(result.refusal)
|
||||
const resolved = resolveRefusal(result.refusal, copy)
|
||||
|
||||
setMessage({
|
||||
kind: 'error',
|
||||
@@ -121,8 +123,8 @@ export function useStepUpFlow() {
|
||||
if (!result.data.granted) {
|
||||
setMessage({
|
||||
kind: 'error',
|
||||
text: 'Verification finished without allowing Remote Spending for this terminal.',
|
||||
title: 'Verification was not approved'
|
||||
text: copy.verificationDeniedMessage,
|
||||
title: copy.verificationDeniedTitle
|
||||
})
|
||||
|
||||
return
|
||||
@@ -134,10 +136,10 @@ export function useStepUpFlow() {
|
||||
])
|
||||
setMessage({
|
||||
kind: 'success',
|
||||
text: 'Remote Spending is allowed for this terminal.',
|
||||
title: 'Verification complete'
|
||||
text: copy.verificationDoneMessage,
|
||||
title: copy.verificationDoneTitle
|
||||
})
|
||||
}, [api, gateway, queryClient, unsubscribe])
|
||||
}, [api, gateway, queryClient, unsubscribe, copy])
|
||||
|
||||
return { dismiss, message, openVerification, phase, start, verification }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user