fix(frontend): Catch config fetch error and set default fallback (#4453)

This commit is contained in:
sp.wack 2024-10-17 20:17:44 +04:00 committed by GitHub
parent ad800bf373
commit 678630c5bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,8 +26,12 @@ import NewProjectIcon from "#/assets/new-project.svg?react";
import DocsIcon from "#/assets/docs.svg?react";
export const clientLoader = async () => {
const config = await OpenHands.getConfig();
window.__APP_MODE__ = config.APP_MODE;
try {
const config = await OpenHands.getConfig();
window.__APP_MODE__ = config.APP_MODE;
} catch (error) {
window.__APP_MODE__ = "oss";
}
let token = localStorage.getItem("token");
const ghToken = localStorage.getItem("ghToken");