77 Event ,
88 checkUserGuideSteps
99} from '../utils/electronEventInterface' ;
10- import { processPendingEvents } from '../utils/ipc' ;
10+ import { checkForUpdates , processPendingEvents } from '../utils/ipc' ;
1111import { LabelType , getPendingRestoreStatus } from '../utils/electronInterface' ;
1212import { SectionType } from '../utils/const' ;
1313import {
@@ -21,6 +21,7 @@ import { USER_GUIDE_STEPS } from './UserGuide';
2121
2222const MAILBOX_POPUP_TYPES = {
2323 ACCOUNT_DELETED : 'account-deleted' ,
24+ BIG_UPDATE_AVAILABLE : 'big-update-available' ,
2425 CREATING_BACKUP_FILE : 'creating-backup-file' ,
2526 DEVICE_REMOVED : 'device-removed' ,
2627 MIGRATE_ALICE : 'migrate-alice' ,
@@ -42,6 +43,7 @@ class PanelWrapper extends Component {
4243 isOpenSideBar : true ,
4344 isOpenWelcome : true ,
4445 mailboxPopupType : undefined ,
46+ mailboxPopupData : undefined ,
4547 sectionSelected : {
4648 type : SectionType . MAILBOX ,
4749 params : {
@@ -72,13 +74,15 @@ class PanelWrapper extends Component {
7274 isOpenSideBar = { this . state . isOpenSideBar }
7375 isOpenWelcome = { this . state . isOpenWelcome }
7476 mailboxPopupType = { this . state . mailboxPopupType }
77+ mailboxPopupData = { this . state . mailboxPopupData }
7578 onClickCloseWelcome = { this . handleCloseWelcome }
7679 onClickSection = { this . handleClickSection }
7780 onClickThreadBack = { this . handleClickThreadBack }
7881 onCloseMailboxPopup = { this . handleCloseMailboxPopup }
7982 onToggleActivityPanel = { this . handleToggleActivityPanel }
8083 onToggleSideBar = { this . handleToggleSideBar }
8184 sectionSelected = { this . state . sectionSelected }
85+ onUpdateNow = { this . handleUpdateNow }
8286 { ...this . props }
8387 />
8488 ) ;
@@ -90,6 +94,11 @@ class PanelWrapper extends Component {
9094 this . handleCheckRestoreBackup ( ) ;
9195 }
9296
97+ handleUpdateNow = ( ) => {
98+ checkForUpdates ( true ) ;
99+ this . handleCloseMailboxPopup ( ) ;
100+ } ;
101+
93102 handleClickSection = ( type , params ) => {
94103 switch ( type ) {
95104 case SectionType . MAILBOX :
@@ -189,7 +198,8 @@ class PanelWrapper extends Component {
189198 handleCloseMailboxPopup = ( ) => {
190199 this . setState ( {
191200 isHiddenMailboxPopup : true ,
192- mailboxPopupType : undefined
201+ mailboxPopupType : undefined ,
202+ mailboxPopupData : undefined
193203 } ) ;
194204 } ;
195205
@@ -210,6 +220,7 @@ class PanelWrapper extends Component {
210220 addEvent ( Event . ACCOUNT_DELETED , this . accountDeletedListenerCallback ) ;
211221 addEvent ( Event . SET_SECTION_TYPE , this . setSectionTypeListenerCallback ) ;
212222 addEvent ( Event . SUSPENDED_ACCOUNT , this . suspendedAccountListenerCallback ) ;
223+ addEvent ( Event . BIG_UPDATE_AVAILABLE , this . handleBigUpdateListenerCallback ) ;
213224 addEvent (
214225 Event . REACTIVATED_ACCOUNT ,
215226 this . reactivatedAccountListenerCallback
@@ -266,7 +277,8 @@ class PanelWrapper extends Component {
266277 enableWindowListenerCallback = ( ) => {
267278 this . setState ( {
268279 isHiddenMailboxPopup : true ,
269- mailboxPopupType : undefined
280+ mailboxPopupType : undefined ,
281+ mailboxPopupData : undefined
270282 } ) ;
271283 } ;
272284
@@ -501,6 +513,14 @@ class PanelWrapper extends Component {
501513 } ) ;
502514 } ;
503515
516+ handleBigUpdateListenerCallback = data => {
517+ this . setState ( {
518+ isHiddenMailboxPopup : false ,
519+ mailboxPopupType : MAILBOX_POPUP_TYPES . BIG_UPDATE_AVAILABLE ,
520+ mailboxPopupData : data
521+ } ) ;
522+ } ;
523+
504524 reactivatedAccountListenerCallback = ( ) => {
505525 const isShowingPopup = ! this . state . isHiddenMailboxPopup ;
506526 const isVisibleSuspendedAccountPopup =
0 commit comments