Skip to content

Commit

Permalink
Bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
bia-pain-bache committed Oct 13, 2024
1 parent 31e5d38 commit 35e94c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions _worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,13 +1206,14 @@ async function getDataset(env) {
throw new Error(`An error occurred while getting KV - ${error}`);
}

const isUpdated = panelVersion === proxySettings?.panelVersion;
if (!proxySettings || !isUpdated) {
if (!proxySettings) {
proxySettings = await updateDataset(env);
const { error, configs } = await fetchWgConfig(env, proxySettings);
warpConfigs = configs;
if (error) throw new Error(`An error occurred while getting Warp configs - ${error}`);
warpConfigs = configs;
}

if (panelVersion !== proxySettings.panelVersion) proxySettings = await updateDataset(env);
return {kvNotFound: false, proxySettings, warpConfigs}
}

Expand Down

0 comments on commit 35e94c1

Please sign in to comment.