@@ -6,8 +6,8 @@ import YAML from 'yaml';
6
6
import { Common } from '@k8slens/extensions' ;
7
7
import { DATA_CLOUD_EVENTS , DataCloud } from '../common/DataCloud' ;
8
8
import { CONNECTION_STATUSES } from '../common/Cloud' ;
9
- import { cloudStore } from '../store/CloudStore' ;
10
- import { syncStore } from '../store/SyncStore' ;
9
+ import { globalCloudStore } from '../store/CloudStore' ;
10
+ import { globalSyncStore } from '../store/SyncStore' ;
11
11
import { apiCredentialKinds , apiKinds } from '../api/apiConstants' ;
12
12
import { logValue } from '../util/logger' ;
13
13
import * as consts from '../constants' ;
@@ -180,7 +180,7 @@ export class SyncManager extends Singleton {
180
180
// @see https://mobx.js.org/reactions.html#reaction
181
181
reaction (
182
182
// react to changes in `clouds` array
183
- ( ) => cloudStore . clouds ,
183
+ ( ) => globalCloudStore . clouds ,
184
184
this . handleCloudStoreChange ,
185
185
{
186
186
// fire right away because it's unclear if the SyncStore will be loaded by now
@@ -198,11 +198,11 @@ export class SyncManager extends Singleton {
198
198
reaction (
199
199
// react to changes in SyncStore lists
200
200
( ) => ( {
201
- credentials : syncStore . credentials ,
202
- sshKeys : syncStore . sshKeys ,
203
- clusters : syncStore . clusters ,
204
- licenses : syncStore . licenses ,
205
- proxies : syncStore . proxies ,
201
+ credentials : globalSyncStore . credentials ,
202
+ sshKeys : globalSyncStore . sshKeys ,
203
+ clusters : globalSyncStore . clusters ,
204
+ licenses : globalSyncStore . licenses ,
205
+ proxies : globalSyncStore . proxies ,
206
206
} ) ,
207
207
this . handleSyncStoreChange ,
208
208
{
@@ -256,7 +256,7 @@ export class SyncManager extends Singleton {
256
256
? [ this . catalogSource ]
257
257
: // NOTE: we can't just flatten all the SyncStore lists into one because it'll lose its observability
258
258
// and we won't get actual models, we'll get "Mobx binding items" of some kind (not what you think!)
259
- syncStore . getListNames ( ) . map ( ( name ) => syncStore [ name ] ) ;
259
+ globalSyncStore . getListNames ( ) . map ( ( name ) => globalSyncStore [ name ] ) ;
260
260
261
261
lists . forEach ( ( list ) => {
262
262
let idx ;
@@ -1030,7 +1030,7 @@ export class SyncManager extends Singleton {
1030
1030
const oldSyncedDCs = { ...this . dataClouds } ;
1031
1031
1032
1032
// add new DataClouds for new Clouds added to CloudStore
1033
- Object . entries ( cloudStore . clouds ) . forEach ( ( [ cloudUrl , cloud ] ) => {
1033
+ Object . entries ( globalCloudStore . clouds ) . forEach ( ( [ cloudUrl , cloud ] ) => {
1034
1034
if ( ! this . dataClouds [ cloudUrl ] ) {
1035
1035
// NOTE: SyncManager only runs on the MAIN thread and always needs full data
1036
1036
// so we create full instances, not preview ones
@@ -1057,7 +1057,7 @@ export class SyncManager extends Singleton {
1057
1057
// which will soon dispatch DataCloud.EVENTS.DATA_UPDATED events, calling the
1058
1058
// `SyncManager.handleDataCloudUpdated()` handler
1059
1059
Object . keys ( oldSyncedDCs ) . forEach ( ( cloudUrl ) => {
1060
- if ( cloudStore . clouds [ cloudUrl ] ) {
1060
+ if ( globalCloudStore . clouds [ cloudUrl ] ) {
1061
1061
// still exists so remove from the old list so we don't destroy it
1062
1062
// NOTE: the CloudStore is careful to update existing Cloud instances when
1063
1063
// they change in the cloud-store.json file, and those updates will cause
@@ -1317,7 +1317,7 @@ export class SyncManager extends Singleton {
1317
1317
// avoid them taking place while we're still churning through Cloud updates
1318
1318
// NOTE: we can update the `catalogSource` directly because we don't watch it;
1319
1319
// it's a one-way change here and reflected in Lens
1320
- const jsonStore = syncStore . toPureJSON ( ) ;
1320
+ const jsonStore = globalSyncStore . toPureJSON ( ) ;
1321
1321
1322
1322
const types = [
1323
1323
'clusters' ,
@@ -1343,7 +1343,9 @@ export class SyncManager extends Singleton {
1343
1343
await this . updateCatalogEntities ( dataCloud , resources , jsonStore ) ;
1344
1344
1345
1345
// save the models in the store
1346
- Object . keys ( jsonStore ) . forEach ( ( key ) => ( syncStore [ key ] = jsonStore [ key ] ) ) ;
1346
+ Object . keys ( jsonStore ) . forEach (
1347
+ ( key ) => ( globalSyncStore [ key ] = jsonStore [ key ] )
1348
+ ) ;
1347
1349
1348
1350
this . ipcMain . capture (
1349
1351
'info' ,
0 commit comments