diff options
author | Sebastian <sebasjm@gmail.com> | 2023-02-25 19:43:45 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-02-25 19:43:59 -0300 |
commit | 1723f16b9c4b008e9e44578c2587c7a1bd6560b4 (patch) | |
tree | 4c10315d97edcdf215e3cd329ffb67231adf135e /packages/demobank-ui/src/hooks | |
parent | dd2599ff94f4ecc878abc9f6c87603fd180ac3de (diff) | |
download | wallet-core-1723f16b9c4b008e9e44578c2587c7a1bd6560b4.tar.xz |
some fixes afte testing demobank with ms
Diffstat (limited to 'packages/demobank-ui/src/hooks')
-rw-r--r-- | packages/demobank-ui/src/hooks/circuit.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/packages/demobank-ui/src/hooks/circuit.ts b/packages/demobank-ui/src/hooks/circuit.ts index 3abe8cd54..6cf543a3c 100644 --- a/packages/demobank-ui/src/hooks/circuit.ts +++ b/packages/demobank-ui/src/hooks/circuit.ts @@ -33,7 +33,7 @@ const useSWR = _useSWR as unknown as SWRHook; export function useAdminAccountAPI(): AdminAccountAPI { const { request } = useAuthenticatedBackend(); const mutateAll = useMatchMutate(); - const { state } = useBackendContext(); + const { state, logIn } = useBackendContext(); if (state.status === "loggedOut") { throw Error("access-api can't be used when the user is not logged In"); } @@ -81,6 +81,13 @@ export function useAdminAccountAPI(): AdminAccountAPI { data, contentType: "json", }); + if (account === state.username) { + await mutateAll(/.*/) + logIn({ + username: account, + password: data.new_password + }) + } return res; }; @@ -288,6 +295,12 @@ export function useRatiosAndFeeConfig(): HttpResponse< keepPreviousData: true, }); + if (data) { + // data.data.ratios_and_fees.sell_out_fee = 2 + if (!data.data.ratios_and_fees.fiat_currency) { + data.data.ratios_and_fees.fiat_currency = "FIAT" + } + } if (data) return data; if (error) return error.info; return { loading: true }; |