Skip to content

Commit 352262d

Browse files
committed
Updates fetch action for home active section
1 parent e731faa commit 352262d

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/webviews/apps/plus/home/components/active-work.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
124124
} satisfies OpenInGraphParams)}
125125
><code-icon icon="gl-graph"></code-icon
126126
></gl-button>
127+
<gl-button
128+
aria-busy="${ifDefined(isFetching)}"
129+
?disabled=${isFetching}
130+
class="section-heading-action"
131+
appearance="toolbar"
132+
tooltip="Fetch"
133+
href=${createCommandLink('gitlens.home.fetch', undefined)}
134+
><code-icon icon="gl-repo-fetch"></code-icon
135+
></gl-button>
127136
${when(
128137
this._homeState.repositories.openCount > 1,
129138
() =>
@@ -229,15 +238,6 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
229238
);
230239
}
231240

232-
// branch actions
233-
actions.push(
234-
html`<action-item
235-
label="Fetch"
236-
icon="gl-repo-fetch"
237-
href=${createCommandLink('gitlens.home.fetch', branchRefs)}
238-
></action-item>`,
239-
);
240-
241241
if (!actions.length) {
242242
return nothing;
243243
}

src/webviews/home/homeWebview.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,13 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
837837
void RepoActions.switchTo(repo!.repo, getReferenceFromBranch(branch));
838838
}
839839

840-
private fetch(refs: BranchRef) {
840+
private fetch(refs?: BranchRef) {
841+
if (refs == null) {
842+
const repo = this.getSelectedRepository();
843+
void RepoActions.fetch(repo);
844+
return;
845+
}
846+
841847
const repo = this._repositoryBranches.get(refs.repoPath);
842848
const branch = repo?.branches.find(b => b.id === refs.branchId);
843849
if (branch == null) return;

0 commit comments

Comments
 (0)