Profile Component now accepts a user-object as paramter.
Started to implement the settings popup
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { chat } from 'src/models';
|
||||
import {chat, responseModel} from 'src/models';
|
||||
import { api } from 'src/boot/axios';
|
||||
import { useUserStore } from 'stores/user-store';
|
||||
|
||||
export const useChatStore = defineStore('chatStore',{
|
||||
state:() => ({
|
||||
chats: [] as chat[],
|
||||
chatsLoaded: false
|
||||
chatsLoaded: false,
|
||||
chatExistsReponse: false,
|
||||
}),
|
||||
actions: {
|
||||
async getChatsByUser(): Promise<chat[]> {
|
||||
@@ -33,6 +34,13 @@ export const useChatStore = defineStore('chatStore',{
|
||||
}
|
||||
console.log(members);
|
||||
return (await api.post("/chats/create/" + chatName, members)).data;
|
||||
},
|
||||
async loadDoesChatExist(keycloakID : string, otherKeycloakID : string) : Promise<responseModel> {
|
||||
return (await api.get("/chats/"+keycloakID+"/"+otherKeycloakID)).data;
|
||||
},
|
||||
doesChatExist(keycloakID : string, otherKeycloakID : string) {
|
||||
this.loadDoesChatExist(keycloakID, otherKeycloakID)
|
||||
.then(m => this.chatExistsReponse = m.success);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import {api} from 'boot/axios';
|
||||
import { ptpUser, responseModel, tenorResponseElement } from 'src/models';
|
||||
import { tenorResponseElement } from 'src/models';
|
||||
import Keycloak from 'keycloak-js';
|
||||
|
||||
export const useTenorStore = defineStore('tenorStore', {
|
||||
|
||||
@@ -49,6 +49,17 @@ export const useUserStore = defineStore('userStore', {
|
||||
getAllPtpUsers() {
|
||||
this.loadAllPtpUsers().then((response : ptpUser[]) => {
|
||||
this.users = response;
|
||||
|
||||
this.users.forEach((user : ptpUser) => {
|
||||
if(user.profilePictureUrl == null) {
|
||||
user.profilePictureUrl = "https://th.bing.com/th/id/R.487fe8708797950ab745a3800c31b7a4?rik=qW3zkDdZfweqmQ&pid=ImgRaw&r=0";
|
||||
}
|
||||
|
||||
if(user.status == null) {
|
||||
user.status = "Hey there, I am using ptpChat!";
|
||||
}
|
||||
})
|
||||
|
||||
this.usersLoaded = true;
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user