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