@@ -25,6 +25,7 @@ import type {
2525} from "@types" ;
2626import { AuthPage , generateAchievementCustomNotificationTest } from "@shared" ;
2727import { isStaging } from "@main/constants" ;
28+ import { logger } from "./logger" ;
2829
2930export class WindowManager {
3031 public static mainWindow : Electron . BrowserWindow | null = null ;
@@ -54,21 +55,25 @@ export class WindowManager {
5455 show : false ,
5556 } ;
5657
58+ private static formatVersionNumber ( version : string ) {
59+ return version . replaceAll ( "." , "-" ) ;
60+ }
61+
5762 private static async loadWindowURL ( window : BrowserWindow , hash : string = "" ) {
5863 // HMR for renderer base on electron-vite cli.
5964 // Load the remote URL for development or the local html file for production.
6065 if ( is . dev && process . env [ "ELECTRON_RENDERER_URL" ] ) {
6166 window . loadURL ( `${ process . env [ "ELECTRON_RENDERER_URL" ] } #/${ hash } ` ) ;
62- } else if ( import . meta. env . MAIN_VITE_RENDERER_URL ) {
67+ } else if ( import . meta. env . MAIN_VITE_LAUNCHER_SUBDOMAIN ) {
6368 // Try to load from remote URL in production
6469 try {
6570 await window . loadURL (
66- `${ import . meta. env . MAIN_VITE_RENDERER_URL } #/${ hash } `
71+ `https://release-v ${ this . formatVersionNumber ( app . getVersion ( ) ) } . ${ import . meta. env . MAIN_VITE_LAUNCHER_SUBDOMAIN } #/${ hash } `
6772 ) ;
6873 } catch ( error ) {
6974 // Fall back to local file if remote URL fails
70- console . error (
71- "Failed to load from MAIN_VITE_RENDERER_URL , falling back to local file:" ,
75+ logger . error (
76+ "Failed to load from MAIN_VITE_LAUNCHER_SUBDOMAIN , falling back to local file:" ,
7277 error
7378 ) ;
7479 window . loadFile ( path . join ( __dirname , "../renderer/index.html" ) , {
0 commit comments