notifications v2 table

This commit is contained in:
Natsumi
2026-02-20 17:19:06 +11:00
parent aa6ae21033
commit 5fe2f8ddf5
15 changed files with 488 additions and 259 deletions

View File

@@ -1,43 +1,45 @@
<template>
<Dialog
:open="changeAvatarImageDialogVisible"
@update:open="(open) => {
if (!open) closeDialog();
}">
@update:open="
(open) => {
if (!open) closeDialog();
}
">
<DialogContent class="x-dialog sm:max-w-212.5">
<DialogHeader>
<DialogTitle>{{ t('dialog.change_content_image.avatar') }}</DialogTitle>
</DialogHeader>
<div>
<input
id="AvatarImageUploadButton"
type="file"
accept="image/*"
style="display: none"
@change="onFileChangeAvatarImage" />
<span>{{ t('dialog.change_content_image.description') }}</span>
<br />
<Button
variant="outline"
size="icon-sm"
:disabled="changeAvatarImageDialogLoading"
@click="uploadAvatarImage">
<Upload />
{{ t('dialog.change_content_image.upload') }}
</Button>
<br />
<div class="inline-block p-1 pb-0 hover:rounded-sm">
<img :src="previousImageUrl" class="img-size" loading="lazy" />
</div>
<input
id="AvatarImageUploadButton"
type="file"
accept="image/*"
style="display: none"
@change="onFileChangeAvatarImage" />
<span>{{ t('dialog.change_content_image.description') }}</span>
<br />
<Button
variant="outline"
size="sm"
:disabled="changeAvatarImageDialogLoading"
@click="uploadAvatarImage">
<Upload />
{{ t('dialog.change_content_image.upload') }}
</Button>
<br />
<div class="inline-block p-1 pb-0 hover:rounded-sm">
<img :src="previousImageUrl" class="img-size" loading="lazy" />
</div>
</div>
</DialogContent>
</Dialog>
</template>
<script setup>
import { Button } from '@/components/ui/button';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { Button } from '@/components/ui/button';
import { Upload } from 'lucide-vue-next';
import { ref } from 'vue';
import { storeToRefs } from 'pinia';

View File

@@ -94,6 +94,7 @@
const { showGalleryPage, refreshEmojiTable } = useGalleryStore();
const { emojiTable } = storeToRefs(useGalleryStore());
const { isLocalUserVrcPlusSupporter } = storeToRefs(useUserStore());
const { isNotificationExpired, handleNotificationV2Hide } = useNotificationStore();
const fileId = ref('');
const displayName = ref('');
@@ -161,14 +162,12 @@
const array = notificationTable.value.data;
for (let i = array.length - 1; i >= 0; i--) {
const ref = array[i];
if (ref.type !== 'boop' || ref.$isExpired || ref.senderUserId !== userId) {
if (ref.type !== 'boop' || isNotificationExpired(ref) || ref.link !== `user:${userId}`) {
continue;
}
notificationRequest.sendNotificationResponse({
notificationId: ref.id,
responseType: 'delete',
responseData: ''
});
console.log('Dismissing boop notification with id', ref.id);
handleNotificationV2Hide(ref.id);
notificationRequest.hideNotificationV2(ref.id);
}
}
</script>