@@ -46,18 +46,10 @@ function User(name, factory) {
4646
4747 // Watch files for changes
4848 fs . watchFile ( this . paths . conf + '/' + 'oryoki-preferences.json' , this . onPreferencesChange . bind ( this ) ) ;
49- this . onPreferencesChange ( ) ;
5049
5150 fs . watchFile ( this . paths . conf + '/' + 'search-dictionary.json' , function ( ) {
52- // @if NODE_ENV='development'
53- c . log ( '[User] Search dictionary has changed' ) ;
54- // @endif
55- this . searchDictionary = this . getConfFile ( 'search-dictionary.json' , this . createSearchDictionary . bind ( this ) ) ;
5651
57- // Update accross all windows
58- for ( var i = 0 ; i < Oryoki . windows . length ; i ++ ) {
59- Oryoki . windows [ i ] . updateConfFiles ( ) ;
60- }
52+ this . onSearchDictionaryChange ( ) ;
6153
6254 if ( Oryoki . focusedWindow ) {
6355 Oryoki . focusedWindow . browser . webContents . send ( 'log-status' , {
@@ -67,6 +59,26 @@ function User(name, factory) {
6759
6860 } . bind ( this ) ) ;
6961
62+ // Init conf file
63+ this . onPreferencesChange ( ) ;
64+ this . onSearchDictionaryChange ( ) ;
65+
66+ }
67+
68+ User . prototype . onSearchDictionaryChange = function ( ) {
69+
70+ // @if NODE_ENV='development'
71+ c . log ( '[User] Search dictionary has changed' ) ;
72+ // @endif
73+ this . searchDictionary = this . getConfFile ( 'search-dictionary.json' , this . createSearchDictionary . bind ( this ) ) ;
74+
75+ // Update accross all windows
76+ if ( Oryoki . focusedWindow ) {
77+ for ( var i = 0 ; i < Oryoki . windows . length ; i ++ ) {
78+ Oryoki . windows [ i ] . updateConfFiles ( ) ;
79+ }
80+ }
81+
7082}
7183
7284User . prototype . onPreferencesChange = function ( ) {
0 commit comments