Fix animated emoji in notifications tab

This commit is contained in:
Natsumi
2025-10-23 18:18:58 +11:00
parent 5747c39106
commit ac622ae35c
5 changed files with 87 additions and 51 deletions
+25 -1
View File
@@ -20,6 +20,8 @@ import { handleImageUploadInput } from '../shared/utils/imageUpload';
import { useAdvancedSettingsStore } from './settings/advanced';
import { watchState } from '../service/watchState';
import miscReq from '../api/misc';
import * as workerTimers from 'worker-timers';
export const useGalleryStore = defineStore('Gallery', () => {
@@ -35,6 +37,8 @@ export const useGalleryStore = defineStore('Gallery', () => {
instanceInventoryQueueWorker: null
});
const cachedEmoji = new Map();
const galleryTable = ref([]);
const galleryDialogVisible = ref(false);
@@ -78,6 +82,7 @@ export const useGalleryStore = defineStore('Gallery', () => {
watch(
() => watchState.isLoggedIn,
(isLoggedIn) => {
cachedEmoji.clear();
galleryTable.value = [];
VRCPlusIconsTable.value = [];
stickerTable.value = [];
@@ -500,6 +505,23 @@ export const useGalleryStore = defineStore('Gallery', () => {
}
}
async function getCachedEmoji(fileId) {
return new Promise((resolve, reject) => {
let ref = cachedEmoji.get(fileId);
if (typeof ref !== 'undefined') {
resolve(ref);
return;
}
miscReq
.getFile({ fileId })
.then((args) => {
cachedEmoji.set(fileId, args.json);
resolve(args.json);
})
.catch(reject);
});
}
return {
state,
@@ -521,6 +543,7 @@ export const useGalleryStore = defineStore('Gallery', () => {
emojiTable,
inventoryTable,
fullscreenImageDialog,
cachedEmoji,
showGalleryDialog,
refreshGalleryTable,
@@ -538,6 +561,7 @@ export const useGalleryStore = defineStore('Gallery', () => {
handleStickerAdd,
handleGalleryImageAdd,
handleFilesList,
queueCheckInstanceInventory
queueCheckInstanceInventory,
getCachedEmoji
};
});