diff --git a/src/components/Emoji.vue b/src/components/Emoji.vue new file mode 100644 index 00000000..b77035d0 --- /dev/null +++ b/src/components/Emoji.vue @@ -0,0 +1,48 @@ + + + diff --git a/src/components/dialogs/SendBoopDialog.vue b/src/components/dialogs/SendBoopDialog.vue index a147c32c..e69e68f0 100644 --- a/src/components/dialogs/SendBoopDialog.vue +++ b/src/components/dialogs/SendBoopDialog.vue @@ -150,24 +150,8 @@ image.versions[image.versions.length - 1].file.url " class="x-popover-image" - style="overflow: hidden; width: 100px; height: 100px; padding: 8px"> -
- + style="padding: 8px"> + @@ -194,7 +178,7 @@ import { storeToRefs } from 'pinia'; import { useI18n } from 'vue-i18n'; - import { generateEmojiStyle, userImage, userStatusClass } from '../../shared/utils'; + import { userImage, userStatusClass } from '../../shared/utils'; import { miscRequest } from '../../api'; import { notificationRequest } from '../../api'; import { photonEmojis } from '../../shared/constants/photon.js'; @@ -204,6 +188,8 @@ import { useNotificationStore } from '../../stores'; import { useUserStore } from '../../stores/user.js'; + import Emoji from '../Emoji.vue'; + const { t } = useI18n(); const { sendBoopDialog } = storeToRefs(useUserStore()); diff --git a/src/stores/gallery.js b/src/stores/gallery.js index 9550b4e3..2381261c 100644 --- a/src/stores/gallery.js +++ b/src/stores/gallery.js @@ -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 }; }); diff --git a/src/views/Notifications/Notification.vue b/src/views/Notifications/Notification.vue index 7e127348..e4164815 100644 --- a/src/views/Notifications/Notification.vue +++ b/src/views/Notifications/Notification.vue @@ -126,13 +126,12 @@