diff --git a/web/src/components/Account.jsx b/web/src/components/Account.jsx index 29f4872c..29fc2b68 100644 --- a/web/src/components/Account.jsx +++ b/web/src/components/Account.jsx @@ -1056,87 +1056,94 @@ const TokensTable = (props) => { - {tokens.map((token) => ( - - - - {token.token.slice(0, 12)} - ... - - handleCopy(token.token)}> - - - - - - - {token.token === session.token() && {t("account_tokens_table_current_session")}} - {token.token !== session.token() && (token.label || "-")} - - - {token.expires ? formatShortDateTime(token.expires, i18n.language) : {t("account_tokens_table_never_expires")}} - - - - {formatShortDateTime(token.last_access, i18n.language)} - - openUrl(`https://whatismyipaddress.com/ip/${token.last_origin}`)}> - - - - - - - {token.token !== session.token() && !token.provisioned && ( - <> - - handleEditClick(token)} aria-label={t("account_tokens_dialog_title_edit")}> - + {tokens.map((token) => { + const hasLastAccess = Number.isFinite(token.last_access) && token.last_access > 0; + const hasLastOrigin = !!token.last_origin; + + return ( + + + + {token.token.slice(0, 12)} + ... + + handleCopy(token.token)}> + - - handleDeleteClick(token)} aria-label={t("account_tokens_dialog_title_delete")}> - - + + + + {token.token === session.token() && {t("account_tokens_table_current_session")}} + {token.token !== session.token() && (token.label || "-")} + + + {token.expires ? formatShortDateTime(token.expires, i18n.language) : {t("account_tokens_table_never_expires")}} + + + + {hasLastAccess ? {formatShortDateTime(token.last_access, i18n.language)} : -} + {hasLastOrigin && ( + + openUrl(`https://whatismyipaddress.com/ip/${token.last_origin}`)}> + + + + )} + + + + {token.token !== session.token() && !token.provisioned && ( + <> + + handleEditClick(token)} aria-label={t("account_tokens_dialog_title_edit")}> + + + + + handleDeleteClick(token)} aria-label={t("account_tokens_dialog_title_delete")}> + + + + > + )} + {token.token === session.token() && ( + + + + + + + + + - > - )} - {token.token === session.token() && ( - - - - - - - - - - - )} - {token.provisioned && ( - - - - - - - - - - - )} - - - ))} + )} + {token.provisioned && ( + + + + + + + + + + + )} + + + ); + })}