Recipient Picker: Fix error (#6647)
This commit is contained in:
parent
1140242b0e
commit
f2b446cf10
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user