Folders: Fix saving excluded peers (#2632)

This commit is contained in:
Alexander Zinchuk 2023-02-21 18:28:09 +01:00
parent 9acabf2a79
commit 723c0b4924
2 changed files with 7 additions and 1 deletions

View File

@ -847,6 +847,11 @@ export async function editChatFolder({
id: number;
folderUpdate: ApiChatFolder;
}) {
// Telegram ignores excluded chats if they also present in the included list
folderUpdate.excludedChatIds = folderUpdate.excludedChatIds.filter((chatId) => {
return !folderUpdate.includedChatIds.includes(chatId);
});
const filter = buildFilterFromApiFolder(folderUpdate);
const isActionSuccessful = await invokeRequest(new GramJs.messages.UpdateDialogFilter({

View File

@ -1,7 +1,8 @@
import type { StateReducer, Dispatch } from '../useReducer';
import useReducer from '../useReducer';
import type { ApiChatFolder } from '../../api/types';
import { pick, omit } from '../../util/iteratees';
import useReducer from '../useReducer';
export type FolderChatType = {
icon: string;