Skip to content

Commit adaae03

Browse files
committed
use isLoadingOnyxValue util
1 parent 1803278 commit adaae03

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/pages/NewChatPage/useGroupDraftRestore.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type {SearchOption} from '@libs/OptionsListUtils';
77
import ONYXKEYS from '@src/ONYXKEYS';
88
import type {Login, PersonalDetails, PersonalDetailsList} from '@src/types/onyx';
99
import type NewGroupChatDraft from '@src/types/onyx/NewGroupChatDraft';
10+
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
1011
import type SelectedOption from './types';
1112

1213
function useGroupDraftRestore(
@@ -30,7 +31,7 @@ function useGroupDraftRestore(
3031
return draft?.participants;
3132
};
3233

33-
const [draftParticipants, {status: draftParticipantsOnyxLoadingStatus}] = useOnyx(ONYXKEYS.NEW_GROUP_CHAT_DRAFT, {
34+
const [draftParticipants, draftParticipantsMetadata] = useOnyx(ONYXKEYS.NEW_GROUP_CHAT_DRAFT, {
3435
selector: draftParticipantsSelector,
3536
});
3637

@@ -89,7 +90,7 @@ function useGroupDraftRestore(
8990
syncDraftRemovals();
9091
}, [draftParticipants]);
9192

92-
const areRestoreInputsReady = areAllPersonalDetailOptionsLoaded && draftParticipantsOnyxLoadingStatus === 'loaded';
93+
const areRestoreInputsReady = areAllPersonalDetailOptionsLoaded && !isLoadingOnyxValue(draftParticipantsMetadata);
9394

9495
// handle reload with existing draft participants
9596
useEffect(() => {

0 commit comments

Comments
 (0)