Recipient Picker: Fix error (#6647)
This commit is contained in:
parent
1140242b0e
commit
f2b446cf10
@ -104,7 +104,7 @@ const RecipientPicker = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const ids = useMemo(() => {
|
const ids = useMemo(() => {
|
||||||
if (!isOpen) return undefined;
|
if (!isOpen) return [];
|
||||||
|
|
||||||
let priorityIds = pinnedIds || [];
|
let priorityIds = pinnedIds || [];
|
||||||
if (currentUserId) {
|
if (currentUserId) {
|
||||||
@ -169,7 +169,7 @@ const RecipientPicker = ({
|
|||||||
shouldRenderFolders,
|
shouldRenderFolders,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const renderingIds = useCurrentOrPrev(ids, true)!;
|
const renderingIds = useCurrentOrPrev(ids, true);
|
||||||
|
|
||||||
const chatFolders = useMemo(() => {
|
const chatFolders = useMemo(() => {
|
||||||
if (!shouldRenderFolders) return undefined;
|
if (!shouldRenderFolders) return undefined;
|
||||||
|
|||||||
@ -2,8 +2,8 @@ import usePreviousDeprecated from './usePreviousDeprecated';
|
|||||||
|
|
||||||
export default function useCurrentOrPrev<T>(
|
export default function useCurrentOrPrev<T>(
|
||||||
current: T, shouldSkipUndefined = false, shouldForceCurrent = false,
|
current: T, shouldSkipUndefined = false, shouldForceCurrent = false,
|
||||||
): T | undefined {
|
): T {
|
||||||
const prev = usePreviousDeprecated(current, shouldSkipUndefined);
|
const prev = usePreviousDeprecated(current, shouldSkipUndefined) as T;
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
return shouldForceCurrent || (current !== null && current !== undefined) ? current : prev;
|
return shouldForceCurrent || (current !== null && current !== undefined) ? current : prev;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user