Phase 5: Real-time updates via Socket.IO
Wire Socket.IO broadcast from all write API routes so board changes propagate instantly to other connected clients. Add session-based auth on socket connections, in-memory presence tracking, and a presence UI in the board header showing who else is viewing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
<script lang="ts">
|
||||
import '../app.css';
|
||||
import type { Snippet } from 'svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { connectSocket, disconnectSocket } from '$lib/stores/socket.js';
|
||||
|
||||
let { children, data }: { children: Snippet; data: { user: any; tenant: any } } = $props();
|
||||
|
||||
onMount(() => {
|
||||
if (data.user) {
|
||||
connectSocket();
|
||||
return () => disconnectSocket();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="min-h-screen bg-gray-50">
|
||||
|
||||
Reference in New Issue
Block a user