Skip to content

Commit

Permalink
refactor: load from server all chatsubscription before open room
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Marins committed Apr 18, 2022
1 parent ad1f974 commit a79df25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/meteor/app/ui-utils/client/lib/openRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { callWithErrorHandling } from '../../../../client/lib/utils/callWithErro
import { call } from '../../../../client/lib/utils/call';
import { RoomManager, RoomHistoryManager } from '..';
import { RoomManager as NewRoomManager } from '../../../../client/lib/RoomManager';
import { Rooms } from '../../../models/client';
import { CachedChatSubscription, Rooms } from '../../../models/client';
import { fireGlobalEvent } from '../../../../client/lib/utils/fireGlobalEvent';
import { roomCoordinator } from '../../../../client/lib/rooms/roomCoordinator';

Expand Down Expand Up @@ -96,6 +96,7 @@ export const openRoom = async function (type, name, render = true) {
if (type === 'd') {
try {
const { rid } = await call('createDirectMessage', ...name.split(', '));
CachedChatSubscription.loadFromServerAndPopulate();
return FlowRouter.go('direct', { rid }, FlowRouter.current().queryParams);
} catch (error) {
console.error(error);
Expand Down

0 comments on commit a79df25

Please sign in to comment.