From 3430a02b6f18c01518a66b3a4a7e4f3ce7c9d9da Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Sat, 6 Jul 2024 12:05:01 +0300 Subject: [PATCH] fix issue with cross tab sync when attempting to sync event.moderated cross tab, first the request store would be updated, thus changing the last store timestamp, then the events store would be updated, and the change would appear old. To facilitate, add a `lastStoreTimestamp` for each store --- src/components/StorageRequest.vue | 7 ++++++- src/plugins/pinia/crosstabsync.js | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/StorageRequest.vue b/src/components/StorageRequest.vue index 81e29d6..a3d38b4 100644 --- a/src/components/StorageRequest.vue +++ b/src/components/StorageRequest.vue @@ -14,7 +14,8 @@ import SkeletonLoading from './SkeletonLoading.vue' const router = useRouter() const request = defineModel() -defineProps({ +const emit = defineEmits(['updateModerated']) +const props = defineProps({ requestId: { type: String, required: true @@ -52,6 +53,9 @@ const timestamps = computed(() => { } }) const requestDetails = computed(() => request.value.request) +function updateEventModerated() { + emit('updateModerated', props.requestId, request.value.moderated) +}