mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-05 17:15:19 +03:00
Show disabled "merged" button when PR merged
This commit is contained in:
parent
28efb148ae
commit
34b10fae7d
@ -233,22 +233,28 @@
|
|||||||
{#if prStatus?.success}
|
{#if prStatus?.success}
|
||||||
<Button
|
<Button
|
||||||
help="Merge pull request and refresh"
|
help="Merge pull request and refresh"
|
||||||
disabled={isUnapplied}
|
disabled={isUnapplied || !$pr$}
|
||||||
loading={isMerging}
|
loading={isMerging}
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
isMerging = true;
|
isMerging = true;
|
||||||
try {
|
try {
|
||||||
if ($pr$) await githubService.merge($pr$.number);
|
if ($pr$) {
|
||||||
branchService.reloadVirtualBranches();
|
await githubService.merge($pr$.number);
|
||||||
fetchPrStatus();
|
}
|
||||||
} catch {
|
} catch {
|
||||||
toasts.error('Failed to merge pull request');
|
toasts.error('Failed to merge pull request');
|
||||||
} finally {
|
} finally {
|
||||||
isMerging = false;
|
isMerging = false;
|
||||||
|
await fetchPrStatus();
|
||||||
|
await branchService.reloadVirtualBranches();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Merge
|
{#if $pr$}
|
||||||
|
Merge
|
||||||
|
{:else}
|
||||||
|
Merged
|
||||||
|
{/if}
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user