Message: Fix pinned icon not disappearing when unpinning all (#2935)
This commit is contained in:
parent
576f052711
commit
9232f5c5fe
@ -73,7 +73,7 @@ import {
|
|||||||
selectLanguageCode,
|
selectLanguageCode,
|
||||||
selectListedIds,
|
selectListedIds,
|
||||||
selectNoWebPage,
|
selectNoWebPage,
|
||||||
selectOutlyingListByMessageId,
|
selectOutlyingListByMessageId, selectPinnedIds,
|
||||||
selectRealLastReadId,
|
selectRealLastReadId,
|
||||||
selectReplyingToId,
|
selectReplyingToId,
|
||||||
selectScheduledMessage,
|
selectScheduledMessage,
|
||||||
@ -459,6 +459,10 @@ addActionHandler('unpinAllMessages', async (global, actions, payload): Promise<v
|
|||||||
await callApi('unpinAllMessages', { chat, threadId: topId });
|
await callApi('unpinAllMessages', { chat, threadId: topId });
|
||||||
|
|
||||||
global = getGlobal();
|
global = getGlobal();
|
||||||
|
const pinnedIds = selectPinnedIds(global, chatId, threadId);
|
||||||
|
pinnedIds?.forEach((id) => {
|
||||||
|
global = updateChatMessage(global, chatId, id, { isPinned: false });
|
||||||
|
});
|
||||||
global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'pinnedIds', []);
|
global = replaceThreadParam(global, chat.id, MAIN_THREAD_ID, 'pinnedIds', []);
|
||||||
setGlobal(global);
|
setGlobal(global);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user