diff --git a/libs/remix-ui/home-tab/src/lib/components/constant.ts b/libs/remix-ui/home-tab/src/lib/components/constant.ts index 6c9c68d49f2..83b45079914 100644 --- a/libs/remix-ui/home-tab/src/lib/components/constant.ts +++ b/libs/remix-ui/home-tab/src/lib/components/constant.ts @@ -1,7 +1,14 @@ -export const HOME_TAB_BASE_URL = process.env.CIRCLE_BRANCH === 'remix_beta' ? - 'https://raw.githubusercontent.com/remix-project-org/remix-dynamics/refs/heads/beta/' : process.env.CIRCLE_BRANCH === 'remix_live' ? - 'https://raw.githubusercontent.com/remix-project-org/remix-dynamics/refs/heads/live/' : - 'https://raw.githubusercontent.com/remix-project-org/remix-dynamics/refs/heads/alpha/' +const branches = { + 'remix-beta.ethereum.org': 'beta', + 'remix-alpha.ethereum.org': 'alpha', + 'remix.ethereum.org': 'live' +} +const getBaseUrl = () => { + const branch = branches[window.location.hostname] || 'live' + return `https://raw.githubusercontent.com/remix-project-org/remix-dynamics/refs/heads/${branch}/` +} + +export const HOME_TAB_BASE_URL = getBaseUrl() export const HOME_TAB_NEW_UPDATES = HOME_TAB_BASE_URL + 'hometab/new-updates.json' -export const HOME_TAB_PLUGIN_LIST = HOME_TAB_BASE_URL + 'hometab/plugin-list.json' \ No newline at end of file +export const HOME_TAB_PLUGIN_LIST = HOME_TAB_BASE_URL + 'hometab/plugin-list.json'