Skip to content

Commit

Permalink
Busts focus provider pr cache when opening pr item on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
axosoft-ramint committed Apr 16, 2024
1 parent 4dab1a6 commit 538fd1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/plus/focus/focus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { createDirectiveQuickPickItem, Directive } from '../../quickpicks/items/
import { command } from '../../system/command';
import { fromNow } from '../../system/date';
import { interpolate } from '../../system/string';
import { openUrl } from '../../system/utils';
import type { FocusAction, FocusActionCategory, FocusGroup, FocusItem } from './focusProvider';
import { groupAndSortFocusItems } from './focusProvider';

Expand Down Expand Up @@ -144,11 +143,11 @@ export class FocusCommand extends QuickCommand<State> {

switch (state.action) {
case 'merge': {
await this.container.focus.merge(state.item);
void this.container.focus.merge(state.item);
break;
}
case 'open':
void openUrl(state.item.url!);
this.container.focus.open(state.item);
break;
case 'review':
case 'switch': {
Expand Down
7 changes: 7 additions & 0 deletions src/plus/focus/focusProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { SearchedIssue } from '../../git/models/issue';
import type { SearchedPullRequest } from '../../git/models/pullRequest';
import { configuration } from '../../system/configuration';
import { getSettledValue } from '../../system/promise';
import { openUrl } from '../../system/utils';
import type { UriTypes } from '../../uris/deepLinks/deepLink';
import { DeepLinkActionType, DeepLinkType } from '../../uris/deepLinks/deepLink';
import type { EnrichablePullRequest, ProviderActionablePullRequest } from '../integrations/providers/models';
Expand Down Expand Up @@ -230,6 +231,12 @@ export class FocusProvider implements Disposable {
this.refresh();
}

open(item: FocusItem): void {
if (item.url == null) return;
void openUrl(item.url);
this._prs = undefined;
}

async switchTo(item: FocusItem): Promise<void> {
const deepLinkUrl = this.getItemBranchDeepLink(item);
if (deepLinkUrl == null) return;
Expand Down

0 comments on commit 538fd1f

Please sign in to comment.