File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,11 @@ export type SyncStateStatus =
7777 | 'syncing'
7878 | 'not_responding' ;
7979export type Discovery = 'random' | 'sequential' ;
80- export type DelegationStatus = 'delegating' | 'not_delegating' ;
80+ export type DelegationStatus =
81+ | 'delegating'
82+ | 'not_delegating'
83+ | 'voting'
84+ | 'voting_and_delegating' ;
8185export type WalletSyncStateProgress = {
8286 quantity : number ;
8387 unit : 'percentage' ;
Original file line number Diff line number Diff line change @@ -33,9 +33,13 @@ export const WalletSyncStateStatuses: {
3333export const WalletDelegationStatuses : {
3434 DELEGATING : DelegationStatus ;
3535 NOT_DELEGATING : DelegationStatus ;
36+ VOTING : DelegationStatus ;
37+ VOTING_AND_DELEGATING : DelegationStatus ;
3638} = {
3739 DELEGATING : 'delegating' ,
3840 NOT_DELEGATING : 'not_delegating' ,
41+ VOTING : 'voting' ,
42+ VOTING_AND_DELEGATING : 'voting_and_delegating' ,
3943} ;
4044export type HwDeviceStatus =
4145 | 'connecting'
@@ -234,10 +238,12 @@ export default class Wallet {
234238
235239 @computed
236240 get isDelegating ( ) : boolean {
237- return this . lastDelegationStakePoolStatus
238- ? this . lastDelegationStakePoolStatus ===
239- WalletDelegationStatuses . DELEGATING
240- : this . delegationStakePoolStatus === WalletDelegationStatuses . DELEGATING ;
241+ const statusToCheck = ( this . lastDelegationStakePoolStatus ||
242+ this . delegationStakePoolStatus ) as DelegationStatus ;
243+ return [
244+ WalletDelegationStatuses . DELEGATING ,
245+ WalletDelegationStatuses . VOTING_AND_DELEGATING ,
246+ ] . includes ( statusToCheck ) ;
241247 }
242248
243249 @computed
You can’t perform that action at this time.
0 commit comments