forked from noxious/client
npm run format
This commit is contained in:
@ -1,10 +1,6 @@
|
||||
<template>
|
||||
<div class="notifications">
|
||||
<Modal v-for="notification in notifications.getNotifications"
|
||||
:key="notification.id"
|
||||
:isModalOpen="true"
|
||||
@modal:close="closeNotification(notification.id)"
|
||||
>
|
||||
<Modal v-for="notification in notifications.getNotifications" :key="notification.id" :isModalOpen="true" @modal:close="closeNotification(notification.id)">
|
||||
<template #modal-body>
|
||||
<p>{{ notification.message }}</p>
|
||||
</template>
|
||||
@ -30,7 +26,7 @@ function setupNotificationListener(connection: any) {
|
||||
notifications.addNotification({
|
||||
id: Math.random().toString(16),
|
||||
message: data.message
|
||||
});
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@ -40,7 +36,9 @@ onMounted(() => {
|
||||
setupNotificationListener(connection)
|
||||
} else {
|
||||
// Watch for changes in the socket connection
|
||||
watch(() => socket.getConnection, (newConnection) => {
|
||||
watch(
|
||||
() => socket.getConnection,
|
||||
(newConnection) => {
|
||||
if (newConnection) setupNotificationListener(newConnection)
|
||||
}
|
||||
)
|
||||
@ -53,4 +51,4 @@ onUnmounted(() => {
|
||||
connection.off('notification')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user