From 242e4e2d3abf5e2a37fd040cbac4a9a807e8934c Mon Sep 17 00:00:00 2001 From: Benjamin Preiser Date: Mon, 8 Jan 2024 18:10:47 -0500 Subject: [PATCH] bug fixes --- .../tokenInputGroups/TokenInputGroups.tsx | 70 +++++++++---------- src/main/webapp/app/pages/AccountPage.tsx | 18 ++--- .../webapp/app/store/AuthenticationStore.ts | 2 +- 3 files changed, 46 insertions(+), 44 deletions(-) diff --git a/src/main/webapp/app/components/tokenInputGroups/TokenInputGroups.tsx b/src/main/webapp/app/components/tokenInputGroups/TokenInputGroups.tsx index 783cb9848..f2aed948d 100644 --- a/src/main/webapp/app/components/tokenInputGroups/TokenInputGroups.tsx +++ b/src/main/webapp/app/components/tokenInputGroups/TokenInputGroups.tsx @@ -65,41 +65,6 @@ export default class TokenInputGroups extends React.Component< Expires in {this.getDuration(expirationDay, expirationHour)} - {this.props.changeTokenExpirationDate && ( - { - if (this.props.extendExpirationDate) - this.props.extendExpirationDate(token, newDate); - }} - /> - )} - - - - - - - - + {this.props.changeTokenExpirationDate && ( + { + if (this.props.extendExpirationDate) + this.props.extendExpirationDate(token, newDate); + }} + /> + )} + + + + + + + + ); diff --git a/src/main/webapp/app/pages/AccountPage.tsx b/src/main/webapp/app/pages/AccountPage.tsx index c04394038..ef3f51c19 100644 --- a/src/main/webapp/app/pages/AccountPage.tsx +++ b/src/main/webapp/app/pages/AccountPage.tsx @@ -83,14 +83,16 @@ export class AccountPage extends React.Component { @action.bound extendExpirationDate(token: Token, newDate: string) { - this.props.authenticationStore.extendExpirationDate(token, newDate).then( - () => { - notifySuccess('Updated Token'); - }, - (error: Error) => { - notifyError(error); - } - ); + this.props.authenticationStore + .extendTokenExpirationDate(token, newDate) + .then( + () => { + notifySuccess('Updated Token'); + }, + (error: Error) => { + notifyError(error); + } + ); } @action.bound diff --git a/src/main/webapp/app/store/AuthenticationStore.ts b/src/main/webapp/app/store/AuthenticationStore.ts index bb2c36b16..6104c5faa 100644 --- a/src/main/webapp/app/store/AuthenticationStore.ts +++ b/src/main/webapp/app/store/AuthenticationStore.ts @@ -157,7 +157,7 @@ class AuthenticationStore { } @action - extendExpirationDate(token: Token, newDate: string) { + extendTokenExpirationDate(token: Token, newDate: string) { return new Promise((resolve, reject) => { client .updateTokenUsingPUT({