chore(debug): add logs for realtime feed
This commit is contained in:
@@ -41,11 +41,15 @@ export const useRealtimeStore = defineStore('realtime', {
|
||||
...payload,
|
||||
receivedAt: new Date().toISOString(),
|
||||
};
|
||||
console.log('🔄 Adding realtime event', event);
|
||||
this.events.unshift(event);
|
||||
console.log('📊 Events in feed:', this.events.length);
|
||||
};
|
||||
if (document.startViewTransition) {
|
||||
console.log('🎬 Using View Transition API for new event');
|
||||
document.startViewTransition(addEvent);
|
||||
} else {
|
||||
console.log('⚠️ View Transition API not supported');
|
||||
addEvent();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
<script setup>
|
||||
import { onMounted } from 'vue'
|
||||
import { onMounted, watch } from 'vue'
|
||||
import { useRealtimeStore } from '@/stores/useRealtime'
|
||||
import RealtimeEventCard from '@/components/realtime/RealtimeEventCard.vue'
|
||||
|
||||
const realtime = useRealtimeStore()
|
||||
|
||||
watch(
|
||||
() => realtime.events.length,
|
||||
(newLen, oldLen) => {
|
||||
console.log(`📈 Feed length changed: ${oldLen} -> ${newLen}`)
|
||||
}
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
realtime.init()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user