Chat Folders: Fix switching folders with the same name (#1611)
This commit is contained in:
parent
cb4749f7c6
commit
1072c61a70
@ -9,6 +9,7 @@ import { NotifyException, NotifySettings, SettingsScreens } from '../../../types
|
|||||||
import { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';
|
import { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';
|
||||||
|
|
||||||
import { IS_TOUCH_ENV } from '../../../util/environment';
|
import { IS_TOUCH_ENV } from '../../../util/environment';
|
||||||
|
import { ALL_FOLDER_ID } from '../../../config';
|
||||||
import { buildCollectionByKey } from '../../../util/iteratees';
|
import { buildCollectionByKey } from '../../../util/iteratees';
|
||||||
import { captureEvents, SwipeDirection } from '../../../util/captureEvents';
|
import { captureEvents, SwipeDirection } from '../../../util/captureEvents';
|
||||||
import { getFolderUnreadDialogs } from '../../../modules/helpers';
|
import { getFolderUnreadDialogs } from '../../../modules/helpers';
|
||||||
@ -110,7 +111,7 @@ const ChatFolders: FC<OwnProps & StateProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{ title: lang.code === 'en' ? 'All' : lang('FilterAllChats') },
|
{ title: lang.code === 'en' ? 'All' : lang('FilterAllChats'), id: ALL_FOLDER_ID },
|
||||||
...displayedFolders.map((folder) => ({
|
...displayedFolders.map((folder) => ({
|
||||||
title: folder.title,
|
title: folder.title,
|
||||||
...(folderCountersById?.[folder.id]),
|
...(folderCountersById?.[folder.id]),
|
||||||
@ -196,7 +197,7 @@ const ChatFolders: FC<OwnProps & StateProps> = ({
|
|||||||
|
|
||||||
function renderCurrentTab(isActive: boolean) {
|
function renderCurrentTab(isActive: boolean) {
|
||||||
const activeFolder = Object.values(chatFoldersById)
|
const activeFolder = Object.values(chatFoldersById)
|
||||||
.find(({ title }) => title === folderTabs![activeChatFolder].title);
|
.find(({ id }) => id === folderTabs![activeChatFolder].id);
|
||||||
|
|
||||||
if (!activeFolder || activeChatFolder === 0) {
|
if (!activeFolder || activeChatFolder === 0) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user