Recipient Picker: Fix error (#6647)

This commit is contained in:
zubiden 2026-02-22 23:42:44 +01:00 committed by Alexander Zinchuk
parent 1140242b0e
commit f2b446cf10
2 changed files with 4 additions and 4 deletions

View File

@ -104,7 +104,7 @@ const RecipientPicker = ({
});
const ids = useMemo(() => {
if (!isOpen) return undefined;
if (!isOpen) return [];
let priorityIds = pinnedIds || [];
if (currentUserId) {
@ -169,7 +169,7 @@ const RecipientPicker = ({
shouldRenderFolders,
]);
const renderingIds = useCurrentOrPrev(ids, true)!;
const renderingIds = useCurrentOrPrev(ids, true);
const chatFolders = useMemo(() => {
if (!shouldRenderFolders) return undefined;

View File

@ -2,8 +2,8 @@ import usePreviousDeprecated from './usePreviousDeprecated';
export default function useCurrentOrPrev<T>(
current: T, shouldSkipUndefined = false, shouldForceCurrent = false,
): T | undefined {
const prev = usePreviousDeprecated(current, shouldSkipUndefined);
): T {
const prev = usePreviousDeprecated(current, shouldSkipUndefined) as T;
// eslint-disable-next-line no-null/no-null
return shouldForceCurrent || (current !== null && current !== undefined) ? current : prev;