Update last message on group call peek
This commit is contained in:
parent
1cc478180e
commit
a24bdc8bd3
2 changed files with 18 additions and 1 deletions
|
@ -43,7 +43,7 @@ import type {
|
|||
ConversationChangedActionType,
|
||||
ConversationRemovedActionType,
|
||||
} from './conversations';
|
||||
import { getConversationCallMode } from './conversations';
|
||||
import { getConversationCallMode, updateLastMessage } from './conversations';
|
||||
import * as log from '../../logging/log';
|
||||
import { strictAssert } from '../../util/assert';
|
||||
import { waitForOnline } from '../../util/waitForOnline';
|
||||
|
@ -402,6 +402,8 @@ const doGroupCallPeek = (
|
|||
peekInfo: formattedPeekInfo,
|
||||
},
|
||||
});
|
||||
|
||||
dispatch(updateLastMessage(conversationId));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -1132,6 +1132,7 @@ export const actions = {
|
|||
unblurAvatar,
|
||||
updateConversationModelSharedGroups,
|
||||
updateGroupAttributes,
|
||||
updateLastMessage,
|
||||
updateSharedGroups,
|
||||
verifyConversationsStoppingSend,
|
||||
};
|
||||
|
@ -4433,6 +4434,20 @@ function maybeUpdateSelectedMessageForDetails(
|
|||
};
|
||||
}
|
||||
|
||||
export function updateLastMessage(
|
||||
conversationId: string
|
||||
): ThunkAction<void, RootStateType, unknown, never> {
|
||||
return async () => {
|
||||
const conversationModel = window.ConversationController.get(conversationId);
|
||||
if (conversationModel == null) {
|
||||
throw new Error(
|
||||
`updateLastMessage: Could not find conversation ${conversationId}`
|
||||
);
|
||||
}
|
||||
await conversationModel.updateLastMessage();
|
||||
};
|
||||
}
|
||||
|
||||
export function reducer(
|
||||
state: Readonly<ConversationsStateType> = getEmptyState(),
|
||||
action: Readonly<
|
||||
|
|
Loading…
Reference in a new issue