Skip to content
This repository was archived by the owner on Aug 1, 2022. It is now read-only.

Commit 7484082

Browse files
committed
don’t show "not replicated" on concurrent patch fetches
When a task to fetch patch details in the background is cancelled because a new request to fetch the details is issued we don’t update `patchStatus`. Signed-off-by: Thomas Scholtes <[email protected]>
1 parent ed040ca commit 7484082

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ui/App/ProjectScreen/Patch.svelte

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,16 @@
5555
async function fetch(): Promise<void> {
5656
try {
5757
const result = await fetchExecutor.run(async () => {
58-
return await patch.getDetails(project, peerId, id);
58+
const details = await patch.getDetails(project, peerId, id);
59+
return { details };
5960
});
6061
61-
if (!result) {
62-
patchStatus = { type: "notReplicated" };
63-
} else {
64-
patchStatus = { type: "ok", ...result };
62+
if (result) {
63+
if (result.details) {
64+
patchStatus = { type: "ok", ...result.details };
65+
} else {
66+
patchStatus = { type: "notReplicated" };
67+
}
6568
}
6669
} catch (err: unknown) {
6770
notification.showException(

0 commit comments

Comments
 (0)