@@ -34,7 +34,7 @@ import { store as panelStore } from '../../guide/guide';
34
34
import { SwissMadeOpenSource } from '../../icon/logo' ;
35
35
import { Footer } from '../../layout/footer' ;
36
36
import { Header } from '../../layout/header' ;
37
- import { toggleForceHide } from '../../sidebar/sidebar' ;
37
+ import { setSidebarStatus } from '../../sidebar/sidebar' ;
38
38
import Status from '../../status/status' ;
39
39
import WaitDialog from '../../wait-dialog/wait-dialog' ;
40
40
import { BackupsV2 } from './backups' ;
@@ -108,8 +108,9 @@ class BitBox02 extends Component<Props, State> {
108
108
private unsubscribe ! : ( ) => void ;
109
109
110
110
public componentWillMount ( ) {
111
- if ( ! panelStore . state . forceHiddenSidebar ) {
112
- toggleForceHide ( ) ;
111
+ const { sidebarStatus } = panelStore . state ;
112
+ if ( [ '' , 'forceCollapsed' ] . includes ( sidebarStatus ) ) {
113
+ setSidebarStatus ( 'forceHidden' ) ;
113
114
}
114
115
}
115
116
@@ -156,12 +157,13 @@ class BitBox02 extends Component<Props, State> {
156
157
}
157
158
158
159
private onStatusChanged = ( ) => {
159
- const { showWizard, unlockOnly } = this . state ;
160
+ const { showWizard, unlockOnly, appStatus } = this . state ;
161
+ const { sidebarStatus } = panelStore . state ;
160
162
apiGet ( this . apiPrefix ( ) + '/status' ) . then ( status => {
161
- if ( status !== 'initialized' && ! panelStore . state . forceHiddenSidebar ) {
162
- toggleForceHide ( ) ;
163
- } else if ( status === 'initialized' && panelStore . state . forceHiddenSidebar ) {
164
- toggleForceHide ( ) ;
163
+ if ( status !== 'initialized' && [ '' , 'forceCollapsed' ] . includes ( sidebarStatus ) ) {
164
+ setSidebarStatus ( 'forceHidden' ) ;
165
+ } else if ( status === 'initialized' && ! [ 'createWallet' , 'restoreBackup' ] . includes ( appStatus ) && sidebarStatus !== '' ) {
166
+ setSidebarStatus ( '' ) ;
165
167
}
166
168
if ( ! showWizard && [ 'connected' , 'unpaired' , 'pairingFailed' , 'uninitialized' , 'seeded' ] . includes ( status ) ) {
167
169
this . setState ( { showWizard : true } ) ;
@@ -183,8 +185,9 @@ class BitBox02 extends Component<Props, State> {
183
185
}
184
186
185
187
public componentWillUnmount ( ) {
186
- if ( this . state . status === 'initialized' && panelStore . state . forceHiddenSidebar ) {
187
- toggleForceHide ( ) ;
188
+ const { sidebarStatus } = panelStore . state ;
189
+ if ( this . state . status === 'initialized' && [ 'forceHidden' , 'forceCollapsed' ] . includes ( sidebarStatus ) ) {
190
+ setSidebarStatus ( '' ) ;
188
191
}
189
192
this . unsubscribe ( ) ;
190
193
}
@@ -514,7 +517,7 @@ class BitBox02 extends Component<Props, State> {
514
517
Continue
515
518
</ Button >
516
519
< Button
517
- secondary
520
+ transparent
518
521
onClick = { ( ) => this . setState ( { appStatus : '' } ) } >
519
522
Go Back
520
523
</ Button >
0 commit comments