Skip to content

Commit

Permalink
do not reuseConnection in withPolicy to avoid infinite loading
Browse files Browse the repository at this point in the history
  • Loading branch information
gijoe0295 committed Nov 15, 2024
1 parent 9056d2d commit e441bc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/workspace/withPolicy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function <TProps extends WithPolicyProps, TRef>(
function WithPolicy(props: Omit<TProps, keyof WithPolicyOnyxProps>, ref: ForwardedRef<TRef>) {
const policyID = getPolicyIDFromRoute(props.route as PolicyRoute);

const [policy, policyResults] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`);
const [policy, policyResults] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {reuseConnection: false});
const [policyDraft, policyDraftResults] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${policyID}`);
const isLoadingPolicy = isLoadingOnyxValue(policyResults, policyDraftResults);

Expand Down

0 comments on commit e441bc6

Please sign in to comment.