gologin 2.1.8 → 2.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/gologin.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gologin",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "description": "A high-level API to control Orbita browser over GoLogin API",
5
5
  "types": "./index.d.ts",
6
6
  "main": "./src/gologin.js",
package/src/gologin.js CHANGED
@@ -60,7 +60,7 @@ export class GoLogin {
60
60
  this.profileOs = 'lin';
61
61
  this.waitWebsocket = options.waitWebsocket ?? true;
62
62
  this.isEmptyFonts = false;
63
-
63
+ this.isFirstSession = false;
64
64
  this.isCloudHeadless = options.isCloudHeadless ?? true;
65
65
 
66
66
  this.tmpdir = tmpdir();
@@ -440,8 +440,10 @@ export class GoLogin {
440
440
  height: parseInt(screenHeight, 10),
441
441
  };
442
442
  if (profile.storageInfo.isNewProfile) {
443
+ this.isFirstSession = true;
443
444
  await this.createZeroProfile(profile.createCookiesTableQuery);
444
445
  } else {
446
+ this.isFirstSession = false;
445
447
  await this.downloadProfileAndExtract(profile, local);
446
448
  }
447
449
 
@@ -924,7 +926,7 @@ export class GoLogin {
924
926
  params = params.concat(this.extra_params);
925
927
  }
926
928
 
927
- if (this.restoreLastSession) {
929
+ if (!this.isFirstSession && this.restoreLastSession) {
928
930
  params.push('--restore-last-session');
929
931
  }
930
932