simplfiy favorite world item

This commit is contained in:
pa
2025-11-05 21:23:23 +09:00
committed by Natsumi
parent 350ac07bdc
commit ca862a1273
3 changed files with 58 additions and 65 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
import { computed, reactive, ref, watch } from 'vue';
import { computed, reactive, ref, toRaw, watch } from 'vue';
import { ElMessage } from 'element-plus';
import { defineStore } from 'pinia';
import { useI18n } from 'vue-i18n';
@@ -342,6 +342,9 @@ export const useFavoriteStore = defineStore('Favorite', () => {
let ref;
const favorite = getCachedFavoritesByObjectId(objectId);
let ctx = state.favoriteObjects.get(objectId);
if (ctx) {
ctx = toRaw(ctx);
}
if (typeof favorite !== 'undefined') {
let isTypeChanged = false;
if (typeof ctx === 'undefined') {