Sfoglia il codice sorgente

Fixes graph gating

main
Keith Daulton 2 anni fa
parent
commit
4950027b10
1 ha cambiato i file con 18 aggiunte e 12 eliminazioni
  1. +18
    -12
      src/git/gitProviderService.ts

+ 18
- 12
src/git/gitProviderService.ts Vedi File

@ -520,11 +520,25 @@ export class GitProviderService implements Disposable {
cacheKey = path;
}
let access = this._accessCache.get(cacheKey);
if (access == null) {
access = this.accessCore(feature, repoPath);
this._accessCache.set(cacheKey, access);
let accessPromise = this._accessCache.get(cacheKey);
if (accessPromise == null) {
accessPromise = this.accessCore(feature, repoPath);
this._accessCache.set(cacheKey, accessPromise);
}
const access = await accessPromise;
if (
feature === PlusFeatures.Graph &&
access.visibility !== RepositoryVisibility.Private &&
access.subscription.current.plan.effective.id === SubscriptionPlanId.Free
) {
return {
allowed: true,
subscription: { current: access.subscription.current },
visibility: access.visibility,
};
}
return access;
}
@ -554,14 +568,6 @@ export class GitProviderService implements Disposable {
if (visibility !== RepositoryVisibility.Private) {
switch (plan) {
case SubscriptionPlanId.Free:
if (feature === PlusFeatures.Graph) {
return {
allowed: true,
subscription: { current: subscription },
visibility: visibility,
};
}
return {
allowed: false,
subscription: { current: subscription, required: SubscriptionPlanId.FreePlus },

Caricamento…
Annulla
Salva