chore: update dependencies and improve configuration handling

- Bump version to 0.0.7 in package.json and update deployment script.
- Add new dependencies in bun.lock for improved functionality.
- Modify loadFromRemote methods in Gitea and general config stores to return boolean for better error handling.
- Enhance BuildConfig component to ensure proper loading state management.
- Simplify RepoCard component by removing duplicate repository access option.
- Update WorkspaceDetailDialog to include workspace link in state management.
- Fix branch default value in createDevConfig function to use a placeholder.
This commit is contained in:
xiongxiao
2026-03-01 01:34:12 +08:00
committed by cnb
parent 0a0acf1fe7
commit 20edf1893e
10 changed files with 113 additions and 29 deletions

View File

@@ -9,7 +9,7 @@ type ConfigState = {
setConfig: (config: Partial<Config>) => void;
resetConfig: () => void;
saveToRemote: () => Promise<void>;
loadFromRemote: () => Promise<void>;
loadFromRemote: () => Promise<boolean>;
checkConfig: (opts?: { isUser?: boolean, reload?: boolean }) => Promise<boolean>;
};
@@ -75,22 +75,24 @@ export const useConfigStore = create<ConfigState>()(
})
if (res.code === 404) {
toast.error('远端配置不存在')
return;
return false;
}
if (res.code === 200) {
const config = res.data?.data as typeof config;
setConfig(config);
toast.success('获取远端配置成功')
return true;
}
return false;
},
checkConfig: async (opts?: { isUser?: boolean, reload?: boolean }) => {
const { CNB_API_KEY } = get().config;
if (!CNB_API_KEY && opts?.isUser) {
await get().loadFromRemote();
if (opts?.reload) {
const res = await get().loadFromRemote();
if (opts?.reload && res) {
location.reload();
}
return true
return res;
}
return false
}