Skip to content

Commit

Permalink
Put default parameters back on getWebView
Browse files Browse the repository at this point in the history
  • Loading branch information
lyonsil committed Dec 5, 2023
1 parent 1075281 commit 244783a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/renderer/services/web-view.service-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,15 +737,9 @@ globalThis.updateWebViewDefinitionById = updateWebViewDefinitionSync;
*/
export const getWebView = async (
webViewType: WebViewType,
layout?: Layout,
options?: GetWebViewOptions,
layout: Layout = { type: 'tab' },
options: GetWebViewOptions = {},
): Promise<WebViewId | undefined> => {
// Parameter defaulting doesn't work with network objects, so do it first thing here
/* eslint-disable no-param-reassign */
if (!layout) layout = { type: 'tab' };
if (!options) options = {};
/* eslint-enable no-param-reassign */

const optionsDefaulted = getWebViewOptionsDefaults(options);
// ENHANCEMENT: If they aren't looking for an existingId, we could get the webview without
// searching for an existing webview and send it to the renderer, skipping the part where we send
Expand Down

0 comments on commit 244783a

Please sign in to comment.