Skip to content

Commit 432fb85

Browse files
committed
fix HMR opening up :5174 urls.
1 parent d76c943 commit 432fb85

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"*.css": "tailwindcss"
5757
},
5858
"go.lintTool": "staticcheck",
59-
"go.lintFlags": ["-checks=all,-ST1005,-QF1003,-ST1000,-ST1003"],
6059
"gopls": {
6160
"analyses": {
6261
"QF1003": false

emain/emain-tabview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class WaveTabView extends WebContentsView {
7474
});
7575
wcIdToWaveTabMap.set(this.webContents.id, this);
7676
if (isDevVite) {
77-
this.webContents.loadURL(`${process.env.ELECTRON_RENDERER_URL}/index.html}`);
77+
this.webContents.loadURL(`${process.env.ELECTRON_RENDERER_URL}/index.html`);
7878
} else {
7979
this.webContents.loadFile(path.join(getElectronAppBasePath(), "frontend", "index.html"));
8080
}

emain/emain-util.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ export function handleCtrlShiftState(sender: Electron.WebContents, waveEvent: Wa
5656
}
5757

5858
export function shNavHandler(event: Electron.Event<Electron.WebContentsWillNavigateEventParams>, url: string) {
59-
if (url.startsWith("http://127.0.0.1:5173/index.html") || url.startsWith("http://localhost:5173/index.html")) {
59+
const isDev = !electron.app.isPackaged;
60+
if (isDev && (url.startsWith("http://127.0.0.1:5173/index.html") || url.startsWith("http://localhost:5173/index.html") ||
61+
url.startsWith("http://127.0.0.1:5174/index.html") || url.startsWith("http://localhost:5174/index.html"))) {
6062
// this is a dev-mode hot-reload, ignore it
6163
console.log("allowing hot-reload of index.html");
6264
return;

staticcheck.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
checks = ["all", "-ST1005", "-QF1003", "-ST1000", "-ST1003"]
2+

0 commit comments

Comments
 (0)