diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index 4ef25d4c..f5c4ca98 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -32,6 +32,7 @@ plugins: - outputJsonMethods=false - useExactTypes=false - esModuleInterop=true + - stringEnums=true - plugin: buf.build/community/pseudomuto-doc:v1.5.1 out: gen opt: diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index 673f049c..ca51cc4d 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -87,7 +87,7 @@ const MemoActionMenu = (props: Props) => { - + diff --git a/web/src/components/ReactionView.tsx b/web/src/components/ReactionView.tsx index 41551eb4..143d99dd 100644 --- a/web/src/components/ReactionView.tsx +++ b/web/src/components/ReactionView.tsx @@ -44,17 +44,19 @@ export const stringifyReactionType = (reactionType: Reaction_Type): string => { } }; -const stringifyUsers = (users: User[]): string => { +const stringifyUsers = (users: User[], reactionType: Reaction_Type): string => { if (users.length === 0) { return ""; } if (users.length < 5) { - return users.map((user) => user.nickname || user.username).join(", "); + return users.map((user) => user.nickname || user.username).join(", ") + " reacted with " + reactionType.toLowerCase(); } - return `${users - .slice(0, 4) - .map((user) => user.nickname || user.username) - .join(", ")} and ${users.length - 4} others`; + return ( + `${users + .slice(0, 4) + .map((user) => user.nickname || user.username) + .join(", ")} and ${users.length - 4} more reacted with ` + reactionType.toLowerCase() + ); }; const ReactionView = (props: Props) => { @@ -93,7 +95,7 @@ const ReactionView = (props: Props) => { }; return ( - +
{ ...state, creatingUser: { ...state.creatingUser, - role: Number(event.target.value) as User_Role, + role: event.target.value as User_Role, }, }); }; diff --git a/web/src/pages/Inboxes.tsx b/web/src/pages/Inboxes.tsx index 63984ada..3b742d89 100644 --- a/web/src/pages/Inboxes.tsx +++ b/web/src/pages/Inboxes.tsx @@ -5,14 +5,17 @@ import MemoCommentMessage from "@/components/Inbox/MemoCommentMessage"; import VersionUpdateMessage from "@/components/Inbox/VersionUpdateMessage"; import MobileHeader from "@/components/MobileHeader"; import { useInboxStore } from "@/store/v1"; -import { Inbox_Type } from "@/types/proto/api/v2/inbox_service"; +import { Inbox_Status, Inbox_Type } from "@/types/proto/api/v2/inbox_service"; import { useTranslate } from "@/utils/i18n"; const Inboxes = () => { const t = useTranslate(); const inboxStore = useInboxStore(); const inboxes = inboxStore.inboxes.sort((a, b) => { - return a.status - b.status; + if (a.status === b.status) { + return 0; + } + return a.status === Inbox_Status.UNREAD ? -1 : 1; }); useEffect(() => {