File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed
packages/components/src/redux Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export const githubInstallationsReducer: Reducer<State> = (
54
54
draft . updatedAt = new Date ( ) . toISOString ( )
55
55
56
56
const installations = action . payload
57
- if ( ! ( installations && installations . length ) ) return
57
+ if ( ! installations ) return
58
58
59
59
const {
60
60
allIds,
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ function* init() {
35
35
const isLogged = selectors . isLoggedSelector ( state )
36
36
if ( ! isLogged ) continue
37
37
38
+ const userPlan = selectors . currentUserPlanSelector ( state )
39
+
38
40
const lastFetchedAt = selectors . installationsLastFetchedRequestAtSelector (
39
41
state ,
40
42
)
@@ -62,17 +64,23 @@ function* init() {
62
64
} ) ( )
63
65
64
66
// only fetch installations tokens if:
65
- // 1. never fetched
66
- // 2. or there are expired ones
67
- // 3. or havent fetched for 50+ minutes
68
- // 4. or just installed the github app on a repo
67
+ // 1. have a paid plan
68
+ // 2. never fetched
69
+ // 3. or there are expired ones
70
+ // 4. or havent fetched for 50+ minutes
71
+ // 5. or just installed the github app on a repo
69
72
if (
70
- lastFetchedAt &&
71
73
! (
72
- hasExpiredInstallationToken ||
73
- ( fetchedNMinutesAgo && fetchedNMinutesAgo > 50 )
74
- ) &&
75
- ! installationIdFromQuery
74
+ userPlan &&
75
+ ( userPlan . status === 'active' || userPlan . status === 'trialing' ) &&
76
+ userPlan . featureFlags . enablePrivateRepositories
77
+ ) ||
78
+ ( lastFetchedAt &&
79
+ ! (
80
+ hasExpiredInstallationToken ||
81
+ ( fetchedNMinutesAgo && fetchedNMinutesAgo > 50 )
82
+ ) &&
83
+ ! installationIdFromQuery )
76
84
) {
77
85
yield put ( actions . refreshInstallationsNoop ( ) )
78
86
continue
You can’t perform that action at this time.
0 commit comments