use ref to replace reactive

This commit is contained in:
pa
2026-02-12 11:18:15 +09:00
parent 10e8008185
commit 5ad4713373
2 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -78,8 +78,8 @@
"zod": "^3.25.76" "zod": "^3.25.76"
}, },
"engines": { "engines": {
"node": ">=24.13.0", "node": ">=24.10.0",
"npm": ">=11.9.0" "npm": ">=11.5.0"
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
+6 -6
View File
@@ -1,4 +1,4 @@
import { computed, nextTick, reactive, ref, shallowReactive, watch } from 'vue'; import { computed, reactive, ref, shallowReactive, watch } from 'vue';
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { toast } from 'vue-sonner'; import { toast } from 'vue-sonner';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
@@ -484,7 +484,7 @@ export const useUserStore = defineStore('User', () => {
delete json.currentAvatarThumbnailImageUrl; delete json.currentAvatarThumbnailImageUrl;
} }
if (typeof ref === 'undefined') { if (typeof ref === 'undefined') {
ref = reactive({ ref = {
ageVerificationStatus: '', ageVerificationStatus: '',
ageVerified: false, ageVerified: false,
allowAvatarCopying: false, allowAvatarCopying: false,
@@ -553,7 +553,7 @@ export const useUserStore = defineStore('User', () => {
$moderations: {}, $moderations: {},
// //
...json ...json
}); };
if (locationStore.lastLocation.playerList.has(json.id)) { if (locationStore.lastLocation.playerList.has(json.id)) {
// update $location_at from instance join time // update $location_at from instance join time
const player = locationStore.lastLocation.playerList.get( const player = locationStore.lastLocation.playerList.get(
@@ -644,12 +644,12 @@ export const useUserStore = defineStore('User', () => {
if (ref.location === 'traveling') { if (ref.location === 'traveling') {
ref.$location = parseLocation(ref.travelingToLocation); ref.$location = parseLocation(ref.travelingToLocation);
if (!currentTravelers.has(ref.id) && ref.travelingToLocation) { if (!currentTravelers.has(ref.id) && ref.travelingToLocation) {
const travelRef = reactive({ const travelRef = ref({
created_at: new Date().toJSON(), created_at: new Date().toJSON(),
...ref ...ref
}); });
currentTravelers.set(ref.id, travelRef); currentTravelers.set(ref.id, travelRef.value);
onPlayerTraveling(travelRef); onPlayerTraveling(travelRef.value);
} }
} else { } else {
ref.$location = parseLocation(ref.location); ref.$location = parseLocation(ref.location);