mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-07 10:26:45 +03:00
Fix bug in sync button
- it was fetching from remote but not re-fetching base branch data
This commit is contained in:
parent
6692acd261
commit
ced7394d7b
@ -6,12 +6,13 @@
|
||||
import { getContext } from '$lib/utils/context';
|
||||
import { VirtualBranchService } from '$lib/vbranches/virtualBranch';
|
||||
|
||||
const gitHostListing = getGitHostListingService();
|
||||
const baseBranchService = getContext(BaseBranchService);
|
||||
const vbranchService = getContext(VirtualBranchService);
|
||||
const baseBranch = baseBranchService.base;
|
||||
|
||||
$: baseServiceBusy$ = baseBranchService.loading;
|
||||
const listingService = getGitHostListingService();
|
||||
|
||||
let loading = $state(false);
|
||||
</script>
|
||||
|
||||
<Button
|
||||
@ -22,16 +23,24 @@
|
||||
outline
|
||||
icon="update-small"
|
||||
help="Last fetch from upstream"
|
||||
loading={$baseServiceBusy$}
|
||||
{loading}
|
||||
on:mousedown={async (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
await baseBranchService.fetchFromRemotes('modal');
|
||||
vbranchService.refresh();
|
||||
$gitHostListing?.refresh();
|
||||
loading = true;
|
||||
try {
|
||||
await baseBranchService.fetchFromRemotes('modal');
|
||||
await Promise.all([
|
||||
$listingService?.refresh(),
|
||||
vbranchService.refresh(),
|
||||
baseBranchService.refresh()
|
||||
]);
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
}}
|
||||
>
|
||||
{#if $baseServiceBusy$}
|
||||
{#if loading}
|
||||
<div class="sync-btn__busy-label">busy…</div>
|
||||
{:else if $baseBranch?.lastFetched}
|
||||
<TimeAgo date={$baseBranch?.lastFetched} />
|
||||
|
Loading…
Reference in New Issue
Block a user