Skip to content

Commit

Permalink
fixes initial value definition for inst and widget id in widget creator
Browse files Browse the repository at this point in the history
  • Loading branch information
clpetersonucf committed Feb 19, 2025
1 parent 3065cdf commit 4a76109
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/components/widget-creator-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ const getWidgetType = path => {
}

const WidgetCreatorPage = () => {
const type = getWidgetType(window.location.pathname)
const pathParams = window.location.pathname.split('/');
const widgetID = pathParams[pathParams.length - 2].split('-')[0];
const instanceID = window.location.hash.substr(1)
const [state, setState] = useState({
widgetHeight: 0,
widgetWidth: 0,
widgetID: undefined,
instanceID: undefined
})
const type = getWidgetType(window.location.pathname)
const pathParams = window.location.pathname.split('/');
const widgetID = pathParams[pathParams.length - 2].split('-')[0];
const instanceID = window.location.hash.substring(1)
const [state, setState] = useState({
widgetHeight: 0,
widgetWidth: 0,
widgetID: widgetID ?? undefined,
instanceID: !!instanceID ? instanceID : undefined
})

// Waits for window values to load from server then sets them
useEffect(() => {
Expand Down

0 comments on commit 4a76109

Please sign in to comment.