@@ -8,7 +8,7 @@ var gsSession = (function() {
8
8
const updateUrl = chrome . extension . getURL ( 'update.html' ) ;
9
9
const updatedUrl = chrome . extension . getURL ( 'updated.html' ) ;
10
10
11
- let initialisationMode = false ;
11
+ let initialisationMode = true ;
12
12
let initPeriodInSeconds ;
13
13
let initTimeoutInSeconds ;
14
14
let sessionId ;
@@ -20,6 +20,7 @@ var gsSession = (function() {
20
20
let startupRecoveryTimeTakenInSeconds ;
21
21
let startupType ;
22
22
let startupLastVersion ;
23
+ let syncedSettingsOnInit ;
23
24
24
25
function initAsPromised ( ) {
25
26
return new Promise ( async function ( resolve ) {
@@ -126,6 +127,10 @@ var gsSession = (function() {
126
127
return updateType ;
127
128
}
128
129
130
+ function setSynchedSettingsOnInit ( syncedSettings ) {
131
+ syncedSettingsOnInit = syncedSettings ;
132
+ }
133
+
129
134
async function runStartupChecks ( ) {
130
135
initialisationMode = true ;
131
136
const currentSessionTabs = await gsChrome . tabsQuery ( ) ;
@@ -182,9 +187,14 @@ var gsSession = (function() {
182
187
async function handleNewInstall ( curVersion ) {
183
188
gsStorage . setLastVersion ( curVersion ) ;
184
189
185
- //show welcome message
186
- const optionsUrl = chrome . extension . getURL ( 'options.html?firstTime' ) ;
187
- await gsChrome . tabsCreate ( optionsUrl ) ;
190
+ // Try to determine if this is a new install for the computer or for the whole profile
191
+ // If settings sync contains non-default options, then we can assume it's only
192
+ // a new install for this computer
193
+ if ( ! syncedSettingsOnInit || Object . keys ( syncedSettingsOnInit ) . length === 0 ) {
194
+ //show welcome message
195
+ const optionsUrl = chrome . extension . getURL ( 'options.html?firstTime' ) ;
196
+ await gsChrome . tabsCreate ( optionsUrl ) ;
197
+ }
188
198
}
189
199
190
200
async function handleUpdate ( currentSessionTabs , curVersion , lastVersion ) {
@@ -970,6 +980,7 @@ var gsSession = (function() {
970
980
getTabCheckTimeTakenInSeconds,
971
981
getRecoveryTimeTakenInSeconds,
972
982
getStartupType,
983
+ setSynchedSettingsOnInit,
973
984
getStartupLastVersion,
974
985
recoverLostTabs,
975
986
triggerDiscardOfAllTabs,
0 commit comments