Skip to content

Commit

Permalink
Relative URL support in createWindow (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeichestakov authored Jul 24, 2023
1 parent 8771672 commit 01598f3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/createWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,19 @@ interface WindowProps {
url?: string;
}

const defaultUrl = `${baseUrl}/desktopApp/auth`;

function createURL(url?: string) {
if (url) {
return url.startsWith("/") ? `${baseUrl}${url}` : url;
}

return defaultUrl;
}

export function createWindow(props?: WindowProps): BrowserWindow {
const backgroundColor = store.getLastSeenBackgroundColor();
const url = props?.url || `${baseUrl}/desktopApp/auth`;
const url = createURL(props?.url);

// For MacOS we use a hidden titlebar and move the traffic lights into the header of the interface
// the corresponding CSS adjustments to enable that live in the repl-it-web repo!
Expand Down

0 comments on commit 01598f3

Please sign in to comment.