Werk hoofdapplicatie bij
Legt de bestaande wijzigingen in de hoofdworktree vast voordat de laatste worktree wordt gemerged.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
// Socket.IO Client
|
||||
const socket = typeof io === 'function' ? io() : null;
|
||||
|
||||
// Join household room if available
|
||||
const householdId = document.querySelector('[data-household-id]')?.dataset.householdId;
|
||||
if (socket && householdId) {
|
||||
socket.emit('join:household', householdId);
|
||||
}
|
||||
|
||||
// Real-time list updates
|
||||
socket?.on('list:updated', (data) => {
|
||||
console.log('📝 Lijst bijgewerkt:', data);
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
socket?.on('item:added', (data) => {
|
||||
console.log('➕ Item toegevoegd:', data);
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
socket?.on('item:toggled', (data) => {
|
||||
console.log('✓ Item afgevinkt:', data);
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
socket?.on('item:removed', (data) => {
|
||||
console.log('✕ Item verwijderd:', data);
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
// Auto-remove alerts
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
document
|
||||
.querySelectorAll(".alert")
|
||||
.forEach(alert => {
|
||||
|
||||
alert.remove();
|
||||
|
||||
});
|
||||
|
||||
}, 4000);
|
||||
|
||||
});
|
||||
|
||||
console.log('✅ PantryHub app geladen');
|
||||
Reference in New Issue
Block a user