Skip to content

Commit

Permalink
Additional fix to prevent premature question_set_get request on creat…
Browse files Browse the repository at this point in the history
…or init with null args
  • Loading branch information
clpetersonucf committed May 8, 2024
1 parent 765a70d commit 7441f64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/widget-creator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const WidgetCreator = ({instId, widgetId, minHeight='', minWidth=''}) => {
queryFn: () => apiGetQuestionSet(instIdRef.current),
staleTime: Infinity,
placeholderData: null,
enabled: !!instance.id, // requires instance state object to be prepopulated
enabled: !!instIdRef.current, // requires instance state object to be prepopulated
onSettled: (data) => {
if ( (data != null ? data.title : undefined) === 'Permission Denied' || (data && data.title === 'error')) {
setCreatorState({...creatorState, invalid: true})
Expand Down

0 comments on commit 7441f64

Please sign in to comment.