fix: multiple bug fixes
All checks were successful
Queue Release Build / prepare (push) Successful in 15s
Deploy Web Apps / deploy (push) Successful in 6m54s
Queue Release Build / build-windows (push) Successful in 16m6s
Queue Release Build / build-linux (push) Successful in 30m58s
Queue Release Build / finalize (push) Successful in 44s
All checks were successful
Queue Release Build / prepare (push) Successful in 15s
Deploy Web Apps / deploy (push) Successful in 6m54s
Queue Release Build / build-windows (push) Successful in 16m6s
Queue Release Build / build-linux (push) Successful in 30m58s
Queue Release Build / finalize (push) Successful in 44s
isolated users, db backup, weird disconnect issues for long voice sessions,
This commit is contained in:
9
electron/cqrs/queries/handlers/getCurrentUserId.ts
Normal file
9
electron/cqrs/queries/handlers/getCurrentUserId.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { DataSource } from 'typeorm';
|
||||
import { MetaEntity } from '../../../entities';
|
||||
|
||||
export async function handleGetCurrentUserId(dataSource: DataSource): Promise<string | null> {
|
||||
const metaRepo = dataSource.getRepository(MetaEntity);
|
||||
const metaRow = await metaRepo.findOne({ where: { key: 'currentUserId' } });
|
||||
|
||||
return metaRow?.value?.trim() || null;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
GetMessageByIdQuery,
|
||||
GetReactionsForMessageQuery,
|
||||
GetUserQuery,
|
||||
GetCurrentUserIdQuery,
|
||||
GetRoomQuery,
|
||||
GetBansForRoomQuery,
|
||||
IsUserBannedQuery,
|
||||
@@ -19,6 +20,7 @@ import { handleGetMessageById } from './handlers/getMessageById';
|
||||
import { handleGetReactionsForMessage } from './handlers/getReactionsForMessage';
|
||||
import { handleGetUser } from './handlers/getUser';
|
||||
import { handleGetCurrentUser } from './handlers/getCurrentUser';
|
||||
import { handleGetCurrentUserId } from './handlers/getCurrentUserId';
|
||||
import { handleGetUsersByRoom } from './handlers/getUsersByRoom';
|
||||
import { handleGetRoom } from './handlers/getRoom';
|
||||
import { handleGetAllRooms } from './handlers/getAllRooms';
|
||||
@@ -34,6 +36,7 @@ export const buildQueryHandlers = (dataSource: DataSource): Record<QueryTypeKey,
|
||||
[QueryType.GetReactionsForMessage]: (query) => handleGetReactionsForMessage(query as GetReactionsForMessageQuery, dataSource),
|
||||
[QueryType.GetUser]: (query) => handleGetUser(query as GetUserQuery, dataSource),
|
||||
[QueryType.GetCurrentUser]: () => handleGetCurrentUser(dataSource),
|
||||
[QueryType.GetCurrentUserId]: () => handleGetCurrentUserId(dataSource),
|
||||
[QueryType.GetUsersByRoom]: () => handleGetUsersByRoom(dataSource),
|
||||
[QueryType.GetRoom]: (query) => handleGetRoom(query as GetRoomQuery, dataSource),
|
||||
[QueryType.GetAllRooms]: () => handleGetAllRooms(dataSource),
|
||||
|
||||
Reference in New Issue
Block a user