diff --git a/src/components/ChatSettingsComponent.vue b/src/components/ChatSettingsComponent.vue index e2ace4f..d58b682 100644 --- a/src/components/ChatSettingsComponent.vue +++ b/src/components/ChatSettingsComponent.vue @@ -9,7 +9,7 @@
-
Mitglieder
+
Mitglieder ({{ members.length }})
@@ -26,7 +26,7 @@
Namen ändern
- +
@@ -41,7 +41,7 @@
{ - props.chat!.profilepicture = image.url; + props.chat!.profilepictureAsString = image.url; + showUnsavedChangesAlert(); } const $q = useQuasar(); @@ -119,6 +122,30 @@ import { sendNotification } from 'src/utils'; const reloadChats = async() => { await chatStore.loadChatsByUser(); }; + + const saveChatChanges = () => { + chatStore.updateChat(props.chat! as chat).then((response : responseModel) => { + showingAlert.value = false; + sendNotification(response.message, response.success); + }); + } + + const showUnsavedChangesAlert = () => { + if(!showingAlert.value) { + $q.notify({ + message: 'Du hast Änderungen vorgenommen, die noch nicht gespeichert wurden', + position: 'top', + timeout: 0, + color: "green", + icon: 'announcement', + actions: [ + { label: 'Änderungen speichern', color: 'white', handler: () => { saveChatChanges() } }, + ] + }); + + showingAlert.value = true; + } + }