@exezt-/webamp 1.5.0-0x724 → 1.5.0-0x726

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.
@@ -7331,10 +7331,14 @@ if (typeof Object.create === 'function') {
7331
7331
 
7332
7332
  class WinampTelegramCustomHandler {
7333
7333
  constructor(emit, options) {
7334
+ var _window, _window$Telegram;
7335
+
7334
7336
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "webamp", void 0);
7335
7337
 
7336
7338
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "maxFileSize", 0x1400000);
7337
7339
 
7340
+ _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "applicationStorage", (_window = window) === null || _window === void 0 ? void 0 : (_window$Telegram = _window.Telegram) === null || _window$Telegram === void 0 ? void 0 : _window$Telegram.WebApp.DeviceStorage);
7341
+
7338
7342
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "telegram", void 0);
7339
7343
 
7340
7344
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "loadCustomTracks", tracks => {
@@ -7344,6 +7348,7 @@ class WinampTelegramCustomHandler {
7344
7348
  });
7345
7349
 
7346
7350
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "updateAppState", () => {
7351
+ this.applicationStorage.setItem("appState", JSON.stringify(this.webamp.__getSerializedState()));
7347
7352
  localStorage.setItem("appState", JSON.stringify(this.webamp.__getSerializedState()));
7348
7353
  });
7349
7354
 
@@ -7531,11 +7536,19 @@ class WinampTelegramCustomHandler {
7531
7536
 
7532
7537
  if (typeof localStorage.getItem('app-state') !== "undefined") {
7533
7538
  this.loadOptions(JSON.parse(localStorage.getItem('app-state')));
7539
+ } else {
7540
+ try {
7541
+ typeof this.applicationStorage.getItem("app-state", v => {
7542
+ this.loadOptions(JSON.parse(v));
7543
+ });
7544
+ } catch (e) {
7545
+ console.log(e);
7546
+ }
7534
7547
  } // emit
7535
7548
 
7536
7549
 
7537
7550
  if (emit !== false) {
7538
- var _window, _window$Telegram;
7551
+ var _window2, _window2$Telegram;
7539
7552
 
7540
7553
  const lastList = this.getCookie('lastlist');
7541
7554
 
@@ -7544,13 +7557,13 @@ class WinampTelegramCustomHandler {
7544
7557
  } // @ts-ignore | because no global var telegram avail in project types
7545
7558
 
7546
7559
 
7547
- if (!((_window = window) !== null && _window !== void 0 && (_window$Telegram = _window.Telegram) !== null && _window$Telegram !== void 0 && _window$Telegram.WebApp)) {
7560
+ if (!((_window2 = window) !== null && _window2 !== void 0 && (_window2$Telegram = _window2.Telegram) !== null && _window2$Telegram !== void 0 && _window2$Telegram.WebApp)) {
7548
7561
  console.error("Telegram is undefined!! Skipping Telegram.WebApp event handler...");
7549
7562
  } else {
7550
- var _window2, _window2$Telegram;
7563
+ var _window3, _window3$Telegram;
7551
7564
 
7552
7565
  // @ts-ignore | because no global var telegram avail in project types
7553
- this.telegram = (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$Telegram = _window2.Telegram) === null || _window2$Telegram === void 0 ? void 0 : _window2$Telegram.WebApp;
7566
+ this.telegram = (_window3 = window) === null || _window3 === void 0 ? void 0 : (_window3$Telegram = _window3.Telegram) === null || _window3$Telegram === void 0 ? void 0 : _window3$Telegram.WebApp;
7554
7567
  this.initializeTelegramWebAppEvents();
7555
7568
  }
7556
7569