mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Notification type fallback
This commit is contained in:
@@ -12,7 +12,7 @@ import { formatDateFilter } from '../../shared/utils';
|
|||||||
import { i18n } from '../../plugin';
|
import { i18n } from '../../plugin';
|
||||||
import { useUiStore, useUserStore } from '../../stores';
|
import { useUiStore, useUserStore } from '../../stores';
|
||||||
|
|
||||||
const { t } = i18n.global;
|
const { t, te } = i18n.global;
|
||||||
|
|
||||||
export const createColumns = ({ onDelete, onDeletePrompt }) => {
|
export const createColumns = ({ onDelete, onDeletePrompt }) => {
|
||||||
const { showUserDialog } = useUserStore();
|
const { showUserDialog } = useUserStore();
|
||||||
@@ -66,9 +66,12 @@ export const createColumns = ({ onDelete, onDeletePrompt }) => {
|
|||||||
header: () => t('table.moderation.type'),
|
header: () => t('table.moderation.type'),
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const type = row.getValue('type');
|
const type = row.getValue('type');
|
||||||
|
const typeKey = `view.moderation.filters.${type}`;
|
||||||
|
const label = te(typeKey) ? t(typeKey) : type;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Badge variant="outline" class="text-muted-foreground">
|
<Badge variant="outline" class="text-muted-foreground">
|
||||||
{t(`view.moderation.filters.${type}`)}
|
{label}
|
||||||
</Badge>
|
</Badge>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import {
|
|||||||
|
|
||||||
import Emoji from '../../components/Emoji.vue';
|
import Emoji from '../../components/Emoji.vue';
|
||||||
|
|
||||||
const { t } = i18n.global;
|
const { t, te } = i18n.global;
|
||||||
|
|
||||||
const isGroupId = (id) => typeof id === 'string' && id.startsWith('grp_');
|
const isGroupId = (id) => typeof id === 'string' && id.startsWith('grp_');
|
||||||
|
|
||||||
@@ -145,7 +145,8 @@ export const createColumns = ({
|
|||||||
header: () => t('table.notification.type'),
|
header: () => t('table.notification.type'),
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const original = row.original;
|
const original = row.original;
|
||||||
const label = t(`view.notification.filters.${original.type}`);
|
const typeKey = `view.notification.filters.${original.type}`;
|
||||||
|
const label = te(typeKey) ? t(typeKey) : original.type;
|
||||||
|
|
||||||
if (original.type === 'invite') {
|
if (original.type === 'invite') {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user