@@ -206,38 +206,6 @@ define([
206
206
}
207
207
}
208
208
209
- var _checkVersion = function ( ) {
210
- // check version timestamp
211
- let nowDate = new Date ( ) ;
212
- vpConfig . getData ( 'version_timestamp' , 'vpcfg' ) . then ( function ( data ) {
213
- let doCheckVersion = false ;
214
- if ( data == undefined ) {
215
- // no timestamp, check version
216
- doCheckVersion = true ;
217
- } else if ( data != '' ) {
218
- let lastCheck = new Date ( parseInt ( data ) ) ;
219
- let diffCheck_now = new Date ( nowDate . getFullYear ( ) , nowDate . getMonth ( ) + 1 , nowDate . getDate ( ) ) ;
220
- let diffCheck_last = new Date ( lastCheck . getFullYear ( ) , lastCheck . getMonth ( ) + 1 , lastCheck . getDate ( ) ) ;
221
-
222
- let diff = Math . abs ( diffCheck_now . getTime ( ) - diffCheck_last . getTime ( ) ) ;
223
- diff = Math . ceil ( diff / ( 1000 * 3600 * 24 ) ) ;
224
-
225
- if ( diff >= 1 ) {
226
- // if More than 1 day passed, check version
227
- doCheckVersion = true ;
228
- }
229
- }
230
-
231
- // check version and update version_timestamp
232
- if ( doCheckVersion == true ) {
233
- vpConfig . checkVpVersion ( true ) ;
234
- }
235
-
236
- } ) . catch ( function ( err ) {
237
- vpLog . display ( VP_LOG_TYPE . ERROR , err ) ;
238
- } )
239
- }
240
-
241
209
//========================================================================
242
210
// External call function
243
211
//========================================================================
@@ -290,9 +258,10 @@ define([
290
258
_addToolBarVpButton ( ) ;
291
259
}
292
260
_loadVpResource ( cfg ) ;
293
- _checkVersion ( ) ;
261
+ vpConfig . checkVersionTimestamp ( ) ;
294
262
295
- if ( cfg . vp_section_display && vpFrame ) {
263
+ if ( ( cfg . vp_section_display && vpFrame )
264
+ || vpConfig . extensionType === 'colab' ) { // CHROME: default to display vp
296
265
vpFrame . openVp ( ) ;
297
266
}
298
267
@@ -319,11 +288,13 @@ define([
319
288
if ( newValue . sessionContext . isReady ) {
320
289
vpLog . display ( VP_LOG_TYPE . LOG , 'vp operations for kernel ready...' ) ;
321
290
vpConfig . readKernelFunction ( ) ;
291
+ vpConfig . checkVersionTimestamp ( ) ;
322
292
}
323
293
newValue . sessionContext . _connectionStatusChanged . connect ( function ( s2 , status ) {
324
294
if ( status === 'connected' ) {
325
295
vpLog . display ( VP_LOG_TYPE . LOG , 'vp operations for kernel ready...' ) ;
326
296
vpConfig . readKernelFunction ( ) ;
297
+ vpConfig . checkVersionTimestamp ( ) ;
327
298
}
328
299
} ) ;
329
300
} else {
0 commit comments