diff --git a/web/src/components/Settings/AccessTokenSection.tsx b/web/src/components/Settings/AccessTokenSection.tsx index 8338aca76..4cd13dd02 100644 --- a/web/src/components/Settings/AccessTokenSection.tsx +++ b/web/src/components/Settings/AccessTokenSection.tsx @@ -29,15 +29,10 @@ const AccessTokenSection = () => { }); }, []); - const handleCreateAccessTokenDialogConfirm = async (created?: UserAccessToken) => { - // Refresh list to reflect server state and include stable fields like issuedAt/expiresAt + const handleCreateAccessTokenDialogConfirm = async (created: UserAccessToken) => { const accessTokens = await listAccessTokens(currentUser.name); setUserAccessTokens(accessTokens); - toast.success( - t("setting.access-token-section.create-dialog.access-token-created", { - description: created?.description ?? t("setting.access-token-section.create-dialog.access-token-created-default"), - }), - ); + toast.success(t("setting.access-token-section.create-dialog.access-token-created", { description: created.description })); }; const handleCreateToken = () => { diff --git a/web/src/locales/en.json b/web/src/locales/en.json index 247a71433..7f001d02e 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -245,7 +245,6 @@ "access-token-deleted": "Access token `{{description}}` deleted", "create-dialog": { "access-token-created": "Access token `{{description}}` created", - "access-token-created-default": "Access token created", "create-access-token": "Create Access Token", "created-at": "Created At", "description": "Description", diff --git a/web/src/pages/Attachments.tsx b/web/src/pages/Attachments.tsx index e8b743be6..7e6d33e40 100644 --- a/web/src/pages/Attachments.tsx +++ b/web/src/pages/Attachments.tsx @@ -55,104 +55,102 @@ const Attachments = observer(() => { }, []); return ( - <> -
- {!md && } -
-
-
-

- - {t("common.attachments")} -

-
-
- - setState({ ...state, searchQuery: e.target.value })} - /> -
+
+ {!md && } +
+
+
+

+ + {t("common.attachments")} +

+
+
+ + setState({ ...state, searchQuery: e.target.value })} + />
-
- {loadingState.isLoading ? ( -
-

{t("resource.fetching-data")}

-
- ) : ( - <> - {filteredAttachments.length === 0 ? ( -
- -

{t("message.no-data")}

-
- ) : ( -
- {Array.from(groupedAttachments.entries()).map(([monthStr, attachments]) => { - return ( -
-
- {dayjs(monthStr).year()} - - {dayjs(monthStr).toDate().toLocaleString(i18n.language, { month: "short" })} - -
-
- {attachments.map((attachment) => { - return ( -
-
- -
-
-

{attachment.filename}

-
+
+
+ {loadingState.isLoading ? ( +
+

{t("resource.fetching-data")}

+
+ ) : ( + <> + {filteredAttachments.length === 0 ? ( +
+ +

{t("message.no-data")}

+
+ ) : ( +
+ {Array.from(groupedAttachments.entries()).map(([monthStr, attachments]) => { + return ( +
+
+ {dayjs(monthStr).year()} + + {dayjs(monthStr).toDate().toLocaleString(i18n.language, { month: "short" })} + +
+
+ {attachments.map((attachment) => { + return ( +
+
+
- ); - })} -
+
+

{attachment.filename}

+
+
+ ); + })}
- ); - })} +
+ ); + })} - {unusedAttachments.length > 0 && ( - <> - -
-
-
-
- {t("resource.unused-resources")} - ({unusedAttachments.length}) -
- {unusedAttachments.map((attachment) => { - return ( -
-
- -
-
-

{attachment.filename}

-
-
- ); - })} + {unusedAttachments.length > 0 && ( + <> + +
+
+
+
+ {t("resource.unused-resources")} + ({unusedAttachments.length})
+ {unusedAttachments.map((attachment) => { + return ( +
+
+ +
+
+

{attachment.filename}

+
+
+ ); + })}
- - )} -
- )} - - )} -
+
+ + )} +
+ )} + + )}
-
- +
+
); });