Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove splash screen and fix loading issue #2731

Merged
merged 15 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
don't need this anymore
  • Loading branch information
joeyballentine committed Apr 4, 2024
commit c6a69330883be6a7d3040a605c7d9c0330f589a7
9 changes: 4 additions & 5 deletions src/renderer/contexts/BackendContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ interface BackendContextState {
backendDownRef: React.MutableRefObject<boolean>;
restart: () => Promise<void>;
connectionState: 'connecting' | 'connected' | 'failed';
backendReady: boolean;
}

export const BackendContext = createContext<Readonly<BackendContextState>>(
Expand Down Expand Up @@ -230,7 +229,6 @@ const useNodes = (backend: Backend, backendDownRef: Readonly<MutableRefObject<bo
scope,
refreshNodes,
connectionState,
backendReady,
};
};

Expand Down Expand Up @@ -293,8 +291,10 @@ export const BackendProvider = memo(
const restartPromiseRef = useRef<Promise<void>>();
const needsNewRestartRef = useRef(false);

const { nodesInfo, schemaInputs, scope, refreshNodes, connectionState, backendReady } =
useNodes(backend, backendDownRef);
const { nodesInfo, schemaInputs, scope, refreshNodes, connectionState } = useNodes(
backend,
backendDownRef
);
const { featureStates, refreshFeatureStates } = useFeatureStates(backend);

const featureStatesMaps = useMemo((): ReadonlyMap<FeatureId, FeatureState> => {
Expand Down Expand Up @@ -373,7 +373,6 @@ export const BackendProvider = memo(
backendDownRef,
restart,
connectionState,
backendReady,
});

return <BackendContext.Provider value={value}>{children}</BackendContext.Provider>;
Expand Down
9 changes: 2 additions & 7 deletions src/renderer/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const edgeTypes: EdgeTypes = {
export const Main = memo(() => {
const { t, ready } = useTranslation();
const { sendAlert } = useContext(AlertBoxContext);
const { connectionState, backendReady, schemata } = useContext(BackendContext);
const { connectionState, schemata } = useContext(BackendContext);
const settings = useSettings();

const reactFlowWrapper = useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -90,12 +90,7 @@ export const Main = memo(() => {

if (connectionState === 'failed') return null;

if (
connectionState === 'connecting' ||
!ready ||
!backendReady ||
schemata.schemata.length === 0
) {
if (connectionState === 'connecting' || !ready || schemata.schemata.length === 0) {
return (
<Box
h="100vh"
Expand Down