Ver a proveniência

Fixes graph gating

main
Keith Daulton há 2 anos
ascendente
cometimento
4950027b10
1 ficheiros alterados com 18 adições e 12 eliminações
  1. +18
    -12
      src/git/gitProviderService.ts

+ 18
- 12
src/git/gitProviderService.ts Ver ficheiro

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

Carregando…
Cancelar
Guardar