File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed
ringcentral-integration/modules/Storage
ringcentral-widgets-demo/dev-server Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ export default class Storage extends StorageBase {
4444 this . store . subscribe ( async ( ) => {
4545 if (
4646 this . _auth . loginStatus === loginStatus . loggedIn &&
47+ ( ! this . _tabManager || this . _tabManager . ready ) &&
4748 ! this . ready
4849 ) {
4950 const storageKey =
@@ -61,7 +62,10 @@ export default class Storage extends StorageBase {
6162 this . store . dispatch ( {
6263 type : this . actionTypes . initSuccess ,
6364 storageKey,
64- data : storedData ,
65+ // To fix same reference in redux store with storedData
66+ data : {
67+ ...storedData ,
68+ } ,
6569 } ) ;
6670 this . _storageHandler = ( { key, value } ) => {
6771 if ( this . ready ) {
@@ -75,8 +79,10 @@ export default class Storage extends StorageBase {
7579 } ;
7680 this . _storage . on ( 'storage' , this . _storageHandler ) ;
7781 } else if (
78- this . _auth . loginStatus === loginStatus . notLoggedIn &&
79- this . ready
82+ (
83+ ( ! ! this . _tabManager && ! this . _tabManager . ready ) ||
84+ this . _auth . notLoggedIn
85+ ) && this . ready
8086 ) {
8187 this . store . dispatch ( {
8288 type : this . actionTypes . reset ,
Original file line number Diff line number Diff line change @@ -140,15 +140,14 @@ import LocalForageStorage from 'ringcentral-integration/lib/LocalForageStorage';
140140 { provide : 'DialerUI' , useClass : DialerUI } ,
141141 { provide : 'Feedback' , useClass : Feedback } ,
142142 { provide : 'UserGuide' , useClass : UserGuide } ,
143- // IndexedDB
144- // {
145- // provide: 'StorageOptions',
146- // useValue: {
147- // StorageProvider: LocalForageStorage,
148- // disableAllowInactiveTabsWrite: false,
149- // },
150- // spread: true
151- // },
143+ {
144+ provide : 'StorageOptions' ,
145+ useValue : {
146+ // StorageProvider: LocalForageStorage, // IndexedDB
147+ disableAllowInactiveTabsWrite : true ,
148+ } ,
149+ spread : true
150+ } ,
152151 ]
153152} )
154153export default class BasePhone extends RcModule {
You can’t perform that action at this time.
0 commit comments