Skip to content

Commit

Permalink
fix Type 'undefined' is not assignable to type 'string'.
Browse files Browse the repository at this point in the history
  • Loading branch information
qcdyx committed Nov 7, 2023
1 parent 1fbe965 commit 2c0fdde
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions web-app/src/app/screens/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,13 @@ export default function APIAccount(): React.ReactElement {
edge='end'
disabled={user?.refreshToken === undefined}
onClick={() => {
handleCopyTokenToClipboard(
user?.refreshToken,
setRefreshTokenCopyResult,
setShowRefreshTokenCopiedTooltip,
);
if (user?.refreshToken != null) {
handleCopyTokenToClipboard(
user.refreshToken,
setRefreshTokenCopyResult,
setShowRefreshTokenCopiedTooltip,
);
}
}}
sx={{
display: 'inline-block',
Expand Down Expand Up @@ -426,11 +428,13 @@ export default function APIAccount(): React.ReactElement {
edge='end'
disabled={user?.accessToken === undefined}
onClick={() => {
handleCopyTokenToClipboard(
user?.accessToken,
setAccessTokenCopyResult,
setShowAccessTokenCopiedTooltip,
);
if (user?.accessToken != null) {
handleCopyTokenToClipboard(
user.accessToken,
setAccessTokenCopyResult,
setShowAccessTokenCopiedTooltip,
);
}
}}
sx={{
display: 'inline-block',
Expand Down

0 comments on commit 2c0fdde

Please sign in to comment.