Kaynağa Gözat

Fixes graph gating

main
Keith Daulton 2 yıl önce
ebeveyn
işleme
4950027b10
1 değiştirilmiş dosya ile 18 ekleme ve 12 silme
  1. +18
    -12
      src/git/gitProviderService.ts

+ 18
- 12
src/git/gitProviderService.ts Dosyayı Görüntüle

@ -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 },

Yükleniyor…
İptal
Kaydet