@@ -10,7 +10,7 @@ import {
10
10
MIN_ACCESS_VERSION_BUILD ,
11
11
} from '../constants/GlobalConstants' ;
12
12
import { OPERATION_HISTORY_OBJECT_PREFIX } from '../constants/ObjectPrefixesConstants' ;
13
- import { MODAL_ERROR , MODAL_SUCCESS } from '../constants/ModalConstants' ;
13
+ import { MODAL_ERROR , MODAL_SUCCESS , MODAL_EXTENSION_INFO } from '../constants/ModalConstants' ;
14
14
import { FORM_CONTRACT_VERIFY , FORM_MANAGE_CONTRACT } from '../constants/FormConstants' ;
15
15
import { CONTRACT_ABI } from '../constants/RouterConstants' ;
16
16
@@ -357,16 +357,26 @@ class ContractActions extends BaseActionsClass {
357
357
manageContract ( contractId , name , icon , description , clickSaveCounter ) {
358
358
return async ( dispatch , getState ) => {
359
359
360
- const isAccessBridge = await dispatch ( GlobalActions . checkAccessToBridge ( ) ) ;
361
- if ( ! isAccessBridge ) return ;
360
+ if ( ! BridgeService . isExist ( ) ) {
361
+ dispatch ( ModalActions . openModal ( MODAL_EXTENSION_INFO , { } ) ) ;
362
+ return ;
363
+ }
362
364
363
365
const isExistActiveAccount = await dispatch ( AccountActions . checkActiveAccount ( ) ) ;
364
366
if ( ! isExistActiveAccount ) return ;
365
367
366
368
const ownerName = getState ( ) . contract . getIn ( [ 'owner' , 'name' ] ) ;
367
369
const ownerId = getState ( ) . contract . getIn ( [ 'owner' , 'id' ] ) ;
368
- const activeAccountId = getState ( ) . global . getIn ( [ 'activeAccount' , 'id' ] ) ;
369
-
370
+ let activeAccountId = getState ( ) . global . getIn ( [ 'activeAccount' , 'id' ] ) || BridgeService . getAccount ( ) . id ;
371
+ if ( ! activeAccountId ) {
372
+ const access = await BridgeService . getAccess ( ) ;
373
+ if ( ! access ) return ;
374
+ await new Promise ( ( resolve ) =>
375
+ setTimeout ( ( ) => {
376
+ resolve ( ) ;
377
+ } , 300 ) ) ;
378
+ activeAccountId = BridgeService . getAccount ( ) . id ;
379
+ }
370
380
if ( activeAccountId !== ownerId ) {
371
381
dispatch ( ModalActions . openModal (
372
382
MODAL_ERROR ,
0 commit comments