wip: optimizations
This commit is contained in:
@@ -61,7 +61,7 @@ type BlockedRoomAccessAction =
|
||||
| ReturnType<typeof RoomsActions.forgetRoom>
|
||||
| ReturnType<typeof RoomsActions.joinRoomFailure>;
|
||||
|
||||
const VIEW_SERVER_LOAD_DELAY_MS = 75;
|
||||
const VIEW_SERVER_LOAD_DELAY_MS = 0;
|
||||
|
||||
@Injectable()
|
||||
export class RoomsEffects {
|
||||
@@ -642,9 +642,11 @@ export class RoomsEffects {
|
||||
onViewServerSuccess$ = createEffect(() =>
|
||||
this.actions$.pipe(
|
||||
ofType(RoomsActions.viewServerSuccess),
|
||||
switchMap(({ room }) => timer(VIEW_SERVER_LOAD_DELAY_MS).pipe(
|
||||
mergeMap(() => [MessagesActions.loadMessages({ roomId: room.id }), UsersActions.loadBans()])
|
||||
))
|
||||
switchMap(({ room }) => VIEW_SERVER_LOAD_DELAY_MS > 0
|
||||
? timer(VIEW_SERVER_LOAD_DELAY_MS).pipe(
|
||||
mergeMap(() => [MessagesActions.loadMessages({ roomId: room.id }), UsersActions.loadBans()])
|
||||
)
|
||||
: of(MessagesActions.loadMessages({ roomId: room.id }), UsersActions.loadBans()))
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user