🐛 fix: handle sync status properly when fetching and reloading data

This commit is contained in:
Mattias Granlund 2023-11-29 10:12:08 +01:00
parent 547fb02d13
commit e9bb16488f

View File

@ -22,13 +22,14 @@
e.preventDefault();
e.stopPropagation();
fetching = true;
syncToCloud(projectId); // don't wait for this
await branchController
.fetchFromTarget()
.then(() => prService.reload())
.finally(() => {
fetching = false;
try {
syncToCloud(projectId); // don't wait for this
await branchController.fetchFromTarget().then(() => {
prService.reload();
});
} finally {
fetching = false;
}
}}
>
{#if !fetching}