From 4cedb79bd61adcd00105a3a83dd6636f4f5648f7 Mon Sep 17 00:00:00 2001 From: Cheng Shi Date: Thu, 7 Nov 2024 16:54:24 -0500 Subject: [PATCH] fix: copy clipboard should work after recreating token --- src/sections/account/api-token-section/ApiTokenSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sections/account/api-token-section/ApiTokenSection.tsx b/src/sections/account/api-token-section/ApiTokenSection.tsx index 16fa563d6..f63edb090 100644 --- a/src/sections/account/api-token-section/ApiTokenSection.tsx +++ b/src/sections/account/api-token-section/ApiTokenSection.tsx @@ -54,7 +54,7 @@ export const ApiTokenSection = ({ repository }: ApiTokenSectionProps) => { } const copyToClipboard = () => { - navigator.clipboard.writeText(apiTokenInfo.apiToken).catch( + navigator.clipboard.writeText(currentApiTokenInfo?.apiToken ?? '').catch( /* istanbul ignore next */ (error) => { console.error('Failed to copy text:', error) }