🐛 fix: Update subscribe name fallback to return '--' instead of 'Unknown'
This commit is contained in:
parent
ee05a73834
commit
0a07d2578e
@ -58,6 +58,9 @@ export default function Page() {
|
||||
accessorKey: 'subscribe_id',
|
||||
header: t('subscribe'),
|
||||
cell: ({ row }) => {
|
||||
if (row.original.type === 4) {
|
||||
return t(`type.${row.getValue('type')}`);
|
||||
}
|
||||
const name = getSubscribeName(row.getValue('subscribe_id'));
|
||||
const quantity = row.original.quantity;
|
||||
return name ? `${name} × ${quantity}` : '';
|
||||
|
||||
@ -44,7 +44,7 @@ export const useSubscribeStore = create<SubscribeState>((set, get) => ({
|
||||
|
||||
// Getters
|
||||
getSubscribeName: (subscribeId?: number) => {
|
||||
if (!subscribeId) return 'Unknown';
|
||||
if (!subscribeId) return '--';
|
||||
const subscribe = get().subscribes.find((s) => s.id === subscribeId);
|
||||
return subscribe?.name ?? `Subscribe ${subscribeId}`;
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user