Skip to content

Commit

Permalink
Change import to conditional import when inside the renderer (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyonsil authored Oct 16, 2023
1 parent 53fdb31 commit 851ecbc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/shared/services/web-view.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ import AsyncVariable from '@shared/utils/async-variable';
import logger from '@shared/services/logger.service';
import LogError from '@shared/log-error.model';
import memoizeOne from 'memoize-one';
import {
getFullWebViewStateById,
setFullWebViewStateById,
} from '@renderer/services/web-view-state.service';

/** rc-dock's onLayoutChange prop made asynchronous - resolves */
export type OnLayoutChangeRCDock = (
Expand Down Expand Up @@ -394,6 +390,11 @@ export const getWebView = async (
throw new Error(`getWebView failed, but you should have seen a different error than this!`);
}

// Conditional import when inside the renderer
const { getFullWebViewStateById, setFullWebViewStateById } = await import(
'@renderer/services/web-view-state.service'
);

// Get the webview definition from the webview provider
const webViewProvider = await webViewProviderService.get(webViewType);

Expand Down

0 comments on commit 851ecbc

Please sign in to comment.