Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jnumainville committed Aug 14, 2024
1 parent 638a1b6 commit b5a1044
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/embed-widget/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ const LAYOUT_SETTINGS = {
function App(): JSX.Element {
const [error, setError] = useState<string>();
const [definition, setDefinition] = useState<dh.ide.VariableDefinition>();
const [sharedObject, setSharedObject] = useState<any>();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const [sharedObject, setSharedObject] = useState<Promise<any>>();
const searchParams = useMemo(
() => new URLSearchParams(window.location.search),
[]
Expand Down Expand Up @@ -123,6 +124,7 @@ function App(): JSX.Element {
log.debug(`Loading shared object for ${name}...`);

const obj = await connection.getSharedObject(name, shared);
console.log(typeof obj);

Check warning on line 127 in packages/embed-widget/src/App.tsx

View workflow job for this annotation

GitHub Actions / unit

Unexpected console statement

setSharedObject(obj);

Expand All @@ -146,7 +148,7 @@ function App(): JSX.Element {
}
initApp();
},
[api, client, connection, dispatch, name, serverConfig, user]
[api, client, connection, dispatch, name, serverConfig, user, shared]
);

const isLoaded =
Expand All @@ -162,9 +164,11 @@ function App(): JSX.Element {
return () => {
if (sharedObject != null) {
return sharedObject;
} else if (definition != null) {
}
if (definition != null) {
return connection.getObject(definition);
}
throw new Error('Definition and shared object are null');
};
}, [connection, definition, sharedObject]);

Expand Down Expand Up @@ -212,7 +216,7 @@ function App(): JSX.Element {
if (sharedObject != null) {
widget = {
type: shared,
name: name,
name,
} as dh.ide.VariableDescriptor;
} else if (definition != null) {
widget = getVariableDescriptor(definition);
Expand All @@ -222,7 +226,7 @@ function App(): JSX.Element {

emitPanelOpen(goldenLayout.eventHub, {
fetch,
widget: widget,
widget,
});
}, [
goldenLayout,
Expand Down

0 comments on commit b5a1044

Please sign in to comment.