Worked on several new features:
- ProfilePictures for users are now pulled from the backend - added a component for chat settings (WIP) - added a loading screen when the backend is not available - reworked the "add chat" feature - started to implement the general send-message functionality
This commit is contained in:
27
src/main.ts
27
src/main.ts
@@ -5,6 +5,8 @@ import App from './App.vue';
|
||||
|
||||
import Keycloak from 'keycloak-js';
|
||||
import {useUserStore} from 'stores/user-store';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useChatStore } from './stores/chat-store';
|
||||
|
||||
const app = createApp(App);
|
||||
const pinia = createPinia();
|
||||
@@ -13,16 +15,41 @@ app.use(pinia);
|
||||
|
||||
|
||||
const userStore = useUserStore();
|
||||
const chatStore = useChatStore();
|
||||
const keycloak: Keycloak = await userStore.initKeycloak();
|
||||
|
||||
const $q = useQuasar();
|
||||
let tries = 1;
|
||||
|
||||
// Anfrage ans Backend
|
||||
|
||||
if (keycloak.subject) {
|
||||
|
||||
userStore.id = keycloak.subject;
|
||||
await userStore.getPtpUserById(keycloak.subject);
|
||||
userStore.loadPtpUsersById(keycloak.subject).then(user => {
|
||||
console.log(JSON.stringify(user));
|
||||
})
|
||||
|
||||
|
||||
|
||||
const interval = setInterval(() => {
|
||||
if(userStore.userLoaded) clearInterval(interval);
|
||||
|
||||
userStore.getPtpUserById(keycloak.subject!).then(user => {
|
||||
console.log("New attempt: " + JSON.stringify(user));
|
||||
console.warn(userStore.userLoaded);
|
||||
}).catch(error => {
|
||||
console.error("Ein Netzwerkfehler ist aufgetreten " + tries);
|
||||
userStore.reconnectTries = tries;
|
||||
|
||||
tries++;
|
||||
});
|
||||
}, 5000);
|
||||
|
||||
chatStore.loadProfilePictures();
|
||||
userStore.loadProfilePictures();
|
||||
|
||||
} else {
|
||||
console.error("hier ist was schlimmes passiert menno");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user