mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-02 06:25:02 +03:00
Improve pull request checks state accuracy
This commit is contained in:
parent
1b9e6649c7
commit
9e41f63e99
@ -75,12 +75,15 @@
|
||||
checksStatus = await githubService.checks($pr$?.targetBranch);
|
||||
lastChecksFetch = createTimeAgoStore(new Date(), true);
|
||||
} catch (e: any) {
|
||||
if (!e.message.includes('No commit found')) {
|
||||
checksError = e.message;
|
||||
// No commit found if branch has been removed or pr merged
|
||||
if (e.message.includes('No commit found')) {
|
||||
checksStatus = { error: 'Could not load checks' };
|
||||
} else {
|
||||
checksError = e.message;
|
||||
toasts.error('Failed to fetch checks');
|
||||
console.error(e);
|
||||
}
|
||||
checksStatus = undefined;
|
||||
} finally {
|
||||
isFetchingChecks = false;
|
||||
}
|
||||
@ -223,17 +226,19 @@
|
||||
>
|
||||
{statusLabel}
|
||||
</Tag>
|
||||
<Tag
|
||||
icon={checksIcon}
|
||||
color={checksColor}
|
||||
filled={checksIcon == 'success-small'}
|
||||
clickable
|
||||
verticalOrientation={isLaneCollapsed}
|
||||
on:mousedown={fetchChecks}
|
||||
help={`Updated ${$lastChecksFetch}`}
|
||||
>
|
||||
{checksText}
|
||||
</Tag>
|
||||
{#if checksStatus !== null}
|
||||
<Tag
|
||||
icon={checksIcon}
|
||||
color={checksColor}
|
||||
filled={checksIcon == 'success-small'}
|
||||
clickable
|
||||
verticalOrientation={isLaneCollapsed}
|
||||
on:mousedown={fetchChecks}
|
||||
help={`Updated ${$lastChecksFetch}`}
|
||||
>
|
||||
{checksText}
|
||||
</Tag>
|
||||
{/if}
|
||||
<Tag
|
||||
icon="open-link"
|
||||
color="ghost"
|
||||
|
Loading…
Reference in New Issue
Block a user