diff --git a/main/build/script.mjs b/main/build/script.mjs index f732e0122..40efa3848 100644 --- a/main/build/script.mjs +++ b/main/build/script.mjs @@ -25,7 +25,7 @@ const visionBuild = await esbuild.build({ outfile: 'dist/vision.js' }) -const mainBuild = await esbuild.context({ +const mainContext = await esbuild.context({ entryPoints: ['src/main.ts'], bundle: true, minify: !isDev, @@ -36,18 +36,19 @@ const mainBuild = await esbuild.context({ 'process.env.STATIC': (isDev) ? '"../build/icons"' : '"."', 'process.env.VITE_DEV_SERVER_URL': (isDev) ? '"http://localhost:5173"' : 'null' }, - plugins: [{ + plugins: (isDev) ? [{ name: 'electron-runner', setup (build) { build.onEnd((result) => { if (!result.errors.length) electronRunner.restart() }) } - }] + }] : [] }) -Promise.all([ - visionBuild, - (isDev) ? mainBuild.watch() : mainBuild -]) -.catch(() => process.exit(1)) +if (isDev) { + await mainContext.watch() +} else { + await mainContext.rebuild() + mainContext.dispose() +} diff --git a/main/package.json b/main/package.json index 3709e616b..24210a964 100644 --- a/main/package.json +++ b/main/package.json @@ -1,6 +1,6 @@ { "name": "awakened-poe-trade", - "version": "3.20.10007", + "version": "3.20.10008", "private": true, "scripts": { "dev": "node build/script.mjs", diff --git a/main/src/shortcuts/HostClipboard.ts b/main/src/shortcuts/HostClipboard.ts index 42a655ff6..e9160df6b 100644 --- a/main/src/shortcuts/HostClipboard.ts +++ b/main/src/shortcuts/HostClipboard.ts @@ -66,7 +66,7 @@ export class HostClipboard { } } } - poll() + setTimeout(poll, POLL_DELAY) }) return this.pollPromise diff --git a/renderer/src/web/background/Leagues.ts b/renderer/src/web/background/Leagues.ts index 92182121b..a78e094f5 100644 --- a/renderer/src/web/background/Leagues.ts +++ b/renderer/src/web/background/Leagues.ts @@ -68,7 +68,7 @@ export const useLeagues = createGlobalState(() => { const leagueIsAlive = tradeLeagues.value.some(league => league.id === selectedId.value) if (!leagueIsAlive && !isPrivateLeague(selectedId.value ?? '')) { - if (tradeLeagues.value.length > 2) { + if (tradeLeagues.value.length > 4) { const TMP_CHALLENGE = 2 selectedId.value = tradeLeagues.value[TMP_CHALLENGE].id } else {