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"
},
"engines": {
"node": ">=24.13.0",
"npm": ">=11.9.0"
"node": ">=24.10.0",
"npm": ">=11.5.0"
}
},
"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 { toast } from 'vue-sonner';
import { useI18n } from 'vue-i18n';
@@ -484,7 +484,7 @@ export const useUserStore = defineStore('User', () => {
delete json.currentAvatarThumbnailImageUrl;
}
if (typeof ref === 'undefined') {
ref = reactive({
ref = {
ageVerificationStatus: '',
ageVerified: false,
allowAvatarCopying: false,
@@ -553,7 +553,7 @@ export const useUserStore = defineStore('User', () => {
$moderations: {},
//
...json
});
};
if (locationStore.lastLocation.playerList.has(json.id)) {
// update $location_at from instance join time
const player = locationStore.lastLocation.playerList.get(
@@ -644,12 +644,12 @@ export const useUserStore = defineStore('User', () => {
if (ref.location === 'traveling') {
ref.$location = parseLocation(ref.travelingToLocation);
if (!currentTravelers.has(ref.id) && ref.travelingToLocation) {
const travelRef = reactive({
const travelRef = ref({
created_at: new Date().toJSON(),
...ref
});
currentTravelers.set(ref.id, travelRef);
onPlayerTraveling(travelRef);
currentTravelers.set(ref.id, travelRef.value);
onPlayerTraveling(travelRef.value);
}
} else {
ref.$location = parseLocation(ref.location);