Global Search: Allow adding to folders from chat results
This commit is contained in:
parent
1aaf5132c3
commit
9415e0da19
@ -30,16 +30,18 @@ type StateProps = {
|
||||
user?: ApiUser;
|
||||
isPinned?: boolean;
|
||||
isMuted?: boolean;
|
||||
canChangeFolder?: boolean;
|
||||
};
|
||||
|
||||
const LeftSearchResultChat: FC<OwnProps & StateProps> = ({
|
||||
chatId,
|
||||
withUsername,
|
||||
onClick,
|
||||
chat,
|
||||
user,
|
||||
isPinned,
|
||||
isMuted,
|
||||
withUsername,
|
||||
onClick,
|
||||
canChangeFolder,
|
||||
}) => {
|
||||
const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();
|
||||
const [isChatFolderModalOpen, openChatFolderModal, closeChatFolderModal] = useFlag();
|
||||
@ -49,6 +51,7 @@ const LeftSearchResultChat: FC<OwnProps & StateProps> = ({
|
||||
user,
|
||||
isPinned,
|
||||
isMuted,
|
||||
canChangeFolder,
|
||||
handleDelete: openDeleteModal,
|
||||
handleChatFolderChange: openChatFolderModal,
|
||||
}, true);
|
||||
@ -104,6 +107,7 @@ export default memo(withGlobal<OwnProps>(
|
||||
user,
|
||||
isPinned,
|
||||
isMuted,
|
||||
canChangeFolder: Boolean(global.chatFolders.orderedIds?.length),
|
||||
};
|
||||
},
|
||||
)(LeftSearchResultChat));
|
||||
|
||||
@ -12,21 +12,21 @@ import useLang from './useLang';
|
||||
const useChatContextActions = ({
|
||||
chat,
|
||||
user,
|
||||
handleDelete,
|
||||
handleChatFolderChange,
|
||||
folderId,
|
||||
isPinned,
|
||||
isMuted,
|
||||
canChangeFolder,
|
||||
handleDelete,
|
||||
handleChatFolderChange,
|
||||
}: {
|
||||
chat: ApiChat | undefined;
|
||||
user: ApiUser | undefined;
|
||||
handleDelete: () => void;
|
||||
handleChatFolderChange: () => void;
|
||||
folderId?: number;
|
||||
isPinned?: boolean;
|
||||
isMuted?: boolean;
|
||||
canChangeFolder?: boolean;
|
||||
handleDelete: () => void;
|
||||
handleChatFolderChange: () => void;
|
||||
}, isInSearch = false) => {
|
||||
const lang = useLang();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user