@@ -348,6 +348,34 @@ module.exports.cleanSessionDataOnShutdown = () => {
348
348
return p
349
349
}
350
350
351
+ /**
352
+ * version information (shown on about:brave)
353
+ */
354
+ const setVersionInformation = ( data ) => {
355
+ try {
356
+ const os = require ( 'os' )
357
+ const versionInformation = [
358
+ { name : 'Brave' , version : app . getVersion ( ) } ,
359
+ { name : 'Muon' , version : process . versions [ 'atom-shell' ] } ,
360
+ { name : 'libchromiumcontent' , version : process . versions [ 'chrome' ] } ,
361
+ { name : 'V8' , version : process . versions . v8 } ,
362
+ { name : 'Node.js' , version : process . versions . node } ,
363
+ { name : 'Update Channel' , version : Channel . channel ( ) } ,
364
+ { name : 'os.platform' , version : os . platform ( ) } ,
365
+ { name : 'os.release' , version : os . release ( ) } ,
366
+ { name : 'os.arch' , version : os . arch ( ) }
367
+ // TODO(bsclifton): read the latest commit hash from a file, etc.
368
+ ]
369
+ data . about = data . about || { }
370
+ data . about . brave = {
371
+ versionInformation : versionInformation
372
+ }
373
+ } catch ( e ) {
374
+ console . log ( 'ERROR calling sessionStore::setVersionInformation(): ' , e )
375
+ }
376
+ return data
377
+ }
378
+
351
379
/**
352
380
* Loads the browser state from storage.
353
381
*
@@ -434,30 +462,13 @@ module.exports.loadAppState = () => {
434
462
return
435
463
}
436
464
}
437
-
438
- // version information (shown on about:brave)
439
- const os = require ( 'os' )
440
- const versionInformation = [
441
- { name : 'Brave' , version : app . getVersion ( ) } ,
442
- { name : 'Muon' , version : process . versions [ 'atom-shell' ] } ,
443
- { name : 'libchromiumcontent' , version : process . versions [ 'chrome' ] } ,
444
- { name : 'V8' , version : process . versions . v8 } ,
445
- { name : 'Node.js' , version : process . versions . node } ,
446
- { name : 'Update Channel' , version : Channel . channel ( ) } ,
447
- { name : 'os.platform' , version : os . platform ( ) } ,
448
- { name : 'os.release' , version : os . release ( ) } ,
449
- { name : 'os.arch' , version : os . arch ( ) }
450
- // TODO(bsclifton): read the latest commit hash from a file, etc.
451
- ]
452
- data . about = data . about || { }
453
- data . about . brave = {
454
- versionInformation : versionInformation
455
- }
465
+ data = setVersionInformation ( data )
456
466
} catch ( e ) {
457
467
// TODO: Session state is corrupted, maybe we should backup this
458
468
// corrupted value for people to report into support.
459
469
console . log ( 'could not parse data: ' , data )
460
470
data = exports . defaultAppState ( )
471
+ data = setVersionInformation ( data )
461
472
}
462
473
locale . init ( data . settings [ settings . LANGUAGE ] ) . then ( ( locale ) => {
463
474
app . setLocale ( locale )
0 commit comments