- Download Properties could not be loaded.
-
-
-);
-
-const renderMainApp = async () => {
- if (!rootElement) return;
-
- // Keep the child entrypoint isolated from the main application module. App
- // imports the persistent Zustand stores, whose module initialization issues
- // main-window-only IPC commands. Loading it in a Properties child creates a
- // second persistence owner and can race the bridge handshake.
- const RootComponent = (await import('./App')).default;
- renderRoot(RootComponent);
-};
-
-const renderPropertiesApp = async () => {
- if (!rootElement) return;
-
- try {
- // Properties starts with the synchronous English catalog and changes locale
- // after its first paint. Waiting for a lazy locale chunk here delays the
- // loading shell and makes native window startup visible to the user.
- const RootComponent = (await import('./components/PropertiesWindowApp')).PropertiesWindowApp;
- renderRoot(RootComponent);
- } catch (error) {
- // A failed lazy chunk must not leave the native window hidden forever. Show
- // a styled, closable failure state and use the same caller-validated native
- // reveal command as the normal child path.
- console.error('Failed to initialize the Properties window:', error);
- renderRoot(PropertiesStartupFailure);
- const fallbackSessionId = crypto.randomUUID();
- void invoke('properties_window_send_ready', { sessionId: fallbackSessionId })
- .then(() => invoke('properties_window_reveal', { sessionId: fallbackSessionId }))
- .catch(revealError => {
- console.error('Failed to reveal the Properties startup error:', revealError);
- });
- }
-};
-
-if (isPropertiesWindow) {
- void renderPropertiesApp();
-} else {
- void i18nReady.then(renderMainApp).catch(error => {
- console.error('Failed to initialize localization:', error);
- void renderMainApp();
- });
-}
+void i18nReady.then(renderApp).catch(error => {
+ console.error('Failed to initialize localization:', error);
+ renderApp();
+});
// Prevent the webview's default context menu ("Reload", etc.) on right-click.
// Individual components that provide custom context menus call preventDefault()