Skip to content

Commit ed02c35

Browse files
authored
Merge pull request #919 from IFRCGo/fix/reload-page-on-new-token
Refetch token list after new token is created
2 parents 197f111 + 556766e commit ed02c35

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.changeset/twelve-pens-reply.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"go-web-app": patch
3+
---
4+
5+
- Refetch token list after new token is created
6+
- Update link for terms and conditions for Montandon

app/src/views/AccountDetails/GenerateMontandonTokenModal/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ const MIN_TITLE_LENGTH = 3;
3030

3131
interface Props {
3232
onClose: () => void;
33+
onCreate: () => void;
3334
}
3435

3536
function GenerateMontandonTokenModal(props: Props) {
36-
const { onClose } = props;
37+
const { onClose, onCreate } = props;
3738
const [accepted, { setTrue: setAcceptedTrue }] = useBooleanState(false);
3839
const strings = useTranslation(i18n);
3940

@@ -51,6 +52,7 @@ function GenerateMontandonTokenModal(props: Props) {
5152
title: context,
5253
expire_timestamp: undefined,
5354
}),
55+
onSuccess: onCreate,
5456
});
5557

5658
const handleAcceptAndGenerateClick = useCallback(
@@ -74,8 +76,7 @@ function GenerateMontandonTokenModal(props: Props) {
7476
termsLink: (
7577
<Link
7678
external
77-
// TODO: use actual link
78-
href="https://github.com/IFRCGo"
79+
href="https://docs.google.com/spreadsheets/d/1kQZQmWk8W4tyE3fhi54Oc2Q-TiLJVUj0/"
7980
withLinkIcon
8081
withUnderline
8182
>

app/src/views/AccountDetails/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export function Component() {
7171
const {
7272
pending: montandonTokenPending,
7373
response: montandonTokenResponse,
74+
retrigger: refetchMontandonTokenList,
7475
} = useRequest({
7576
url: '/api/v2/external-token/',
7677
query: {
@@ -233,6 +234,7 @@ export function Component() {
233234
{showGenerateMontandonTokenModal && (
234235
<GenerateMontandonTokenModal
235236
onClose={setShowGenerateMontandonTokenModalFalse}
237+
onCreate={refetchMontandonTokenList}
236238
/>
237239
)}
238240
</div>

0 commit comments

Comments
 (0)