minor changes

This commit is contained in:
grimhilt
2023-04-14 18:37:01 +02:00
parent b48c834d36
commit 5b62fce48a
7 changed files with 12 additions and 6 deletions

View File

@@ -31,7 +31,7 @@ watch(
.main {
min-width: 700px;
}
/* todo */
/* todo define size automatically */
.content {
width: 700px;
height: 700px;

View File

@@ -14,7 +14,6 @@ interface RoomFromBack {
userId: number;
notSeen: number;
parent_id?: number;
// todo thread
}
interface AccountFromBack {
@@ -99,7 +98,7 @@ const store = createStore<State>({
setActiveRoom(state, payload) {
state.activeRoom = payload;
// todo load room on load page
const room = state.rooms.find((room) => room.id == payload);
const room = roomOnId(state, payload);
if (!room) return;
let roomMessage = msgOnRoomId(state, payload);
if (!roomMessage) {
@@ -201,6 +200,12 @@ const store = createStore<State>({
store.dispatch("fetchMessages", { roomId: roomId, obj: msgOnRoomId(state, roomId) });
return msgOnRoomId(state, roomId)?.messages ?? [];
},
accountOfRoom:
(state) =>
(roomId: number): string | undefined => {
const room = roomOnId(state, roomId);
return state.accounts.find((account) => account.id == room?.mailboxId)?.email;
},
},
actions: {
fetchAccounts: async (context) => {