@@ -46,7 +46,7 @@ interface AvailableRealm {
46
46
type : 'base' | 'catalog' | 'user' ;
47
47
}
48
48
49
- interface CreditInfo {
49
+ interface SubscriptionData {
50
50
plan : string | null ;
51
51
creditsAvailableInPlanAllowance : number | null ;
52
52
creditsIncludedInPlanAllowance : number | null ;
@@ -56,7 +56,7 @@ interface CreditInfo {
56
56
export default class RealmServerService extends Service {
57
57
@service private declare network : NetworkService ;
58
58
@service private declare reset : ResetService ;
59
- @tracked private _creditInfo : CreditInfo | null = null ;
59
+ @tracked private _subscriptionData : SubscriptionData | null = null ;
60
60
private auth : AuthStatus = { type : 'anonymous' } ;
61
61
private client : ExtendedClient | undefined ;
62
62
private availableRealms = new TrackedArray < AvailableRealm > ( [
@@ -176,11 +176,11 @@ export default class RealmServerService extends Service {
176
176
} ) ;
177
177
}
178
178
179
- async fetchCreditInfo ( ) {
180
- if ( this . creditInfo ) {
179
+ async fetchSubscriptionData ( ) {
180
+ if ( this . subscriptionData ) {
181
181
return ;
182
182
}
183
- await this . fetchCreditInfoTask . perform ( ) ;
183
+ await this . fetchSubscriptionDataTask . perform ( ) ;
184
184
}
185
185
186
186
async handleRealmServerEvent ( maybeRealmServerEvent : Partial < IEvent > ) {
@@ -195,15 +195,15 @@ export default class RealmServerService extends Service {
195
195
return ;
196
196
}
197
197
198
- await this . fetchCreditInfoTask . perform ( ) ;
198
+ await this . fetchSubscriptionDataTask . perform ( ) ;
199
199
}
200
200
201
- get creditInfo ( ) {
202
- return this . _creditInfo ;
201
+ get subscriptionData ( ) {
202
+ return this . _subscriptionData ;
203
203
}
204
204
205
- get fetchingCreditInfo ( ) {
206
- return this . fetchCreditInfoTask . isRunning ;
205
+ get fetchingSubscriptionData ( ) {
206
+ return this . fetchSubscriptionDataTask . isRunning ;
207
207
}
208
208
209
209
async fetchCatalogRealms ( ) {
@@ -239,9 +239,9 @@ export default class RealmServerService extends Service {
239
239
return new URL ( url ) ;
240
240
}
241
241
242
- private fetchCreditInfoTask = dropTask ( async ( ) => {
242
+ private fetchSubscriptionDataTask = dropTask ( async ( ) => {
243
243
if ( ! this . client ) {
244
- throw new Error ( `Cannot fetch credit info without matrix client` ) ;
244
+ throw new Error ( `Cannot fetch subscription data without matrix client` ) ;
245
245
}
246
246
await this . login ( ) ;
247
247
if ( this . auth . type !== 'logged-in' ) {
@@ -270,7 +270,7 @@ export default class RealmServerService extends Service {
270
270
json . data ?. attributes ?. creditsIncludedInPlanAllowance ?? null ;
271
271
let extraCreditsAvailableInBalance =
272
272
json . data ?. attributes ?. extraCreditsAvailableInBalance ?? null ;
273
- this . _creditInfo = {
273
+ this . _subscriptionData = {
274
274
plan,
275
275
creditsAvailableInPlanAllowance,
276
276
creditsIncludedInPlanAllowance,
0 commit comments