fix(config-profiles): show Git mount refresh progress

Disable duplicate refresh requests and show in-progress feedback while Git mount sources are refreshed.
This commit is contained in:
2026-07-21 21:14:08 +02:00
parent 25e870ba43
commit 900a8e47a5
7 changed files with 44 additions and 5 deletions
@@ -43,6 +43,7 @@ export const useConfigProfiles = () => {
const [error, setError] = useState<string | null>(null);
const [previewData, setPreviewData] = useState<ResolvedProfile | null>(null);
const [previewingId, setPreviewingId] = useState<string | null>(null);
const [isRefreshingGitMounts, setIsRefreshingGitMounts] = useState(false);
const [formData, setFormData] =
useState<CreateConfigProfileRequest>(defaultForm);
const [includedProfileIds, setIncludedProfileIds] = useState<string[]>([]);
@@ -275,7 +276,10 @@ export const useConfigProfiles = () => {
};
const handleRefreshGitMounts = async (id: string): Promise<boolean> => {
if (isRefreshingGitMounts) return false;
setError(null);
setIsRefreshingGitMounts(true);
try {
const result = await refreshConfigProfileGitMounts(id);
const refreshed = result.refresh_outcomes.filter(
@@ -290,6 +294,8 @@ export const useConfigProfiles = () => {
} catch (err) {
setError(extractErrorMessage(err));
return false;
} finally {
setIsRefreshingGitMounts(false);
}
};
@@ -445,6 +451,7 @@ export const useConfigProfiles = () => {
error,
previewData,
previewingId,
isRefreshingGitMounts,
formData,
includedProfileIds,
dragOverIndex,