@exezt-/webamp 1.5.0-0x729 → 1.5.0-0x731

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.
@@ -3564,7 +3564,7 @@ class WinampTelegramCustomHandler {
3564
3564
 
3565
3565
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "saveLastPlaylist", playlistLink => {
3566
3566
  this.applicationStorage.setItem("lastlist", playlistLink);
3567
- document.cookie = `lastlist=${playlistLink}; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT; secure`;
3567
+ document.cookie = `lastlist=${playlistLink}; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT; SameSite=None; secure`;
3568
3568
  });
3569
3569
 
3570
3570
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "getCookie", name => {
@@ -3641,7 +3641,9 @@ class WinampTelegramCustomHandler {
3641
3641
  }
3642
3642
 
3643
3643
  if (typeof localStorage.getItem('app-state') !== "undefined") {
3644
- this.loadOptions(JSON.parse(localStorage.getItem('app-state')));
3644
+ this.applicationStorage.getItem("app-state", v => {
3645
+ this.loadOptions(JSON.parse(v));
3646
+ }); // this.loadOptions(JSON.parse(localStorage.getItem('app-state')!) as SerializedStateV1);
3645
3647
  } else {
3646
3648
  try {
3647
3649
  this.applicationStorage.getItem("app-state", v => {
@@ -3654,9 +3656,9 @@ class WinampTelegramCustomHandler {
3654
3656
 
3655
3657
 
3656
3658
  if (emit !== false) {
3657
- var _this$getCookie, _window2, _window2$Telegram;
3659
+ var _window2, _window2$Telegram;
3658
3660
 
3659
- const lastList = (_this$getCookie = this.getCookie('lastlist')) !== null && _this$getCookie !== void 0 ? _this$getCookie : this.applicationStorage.getItem("lastlist");
3661
+ const lastList = this.applicationStorage.getItem("lastlist"); //this.getCookie('lastlist') ??
3660
3662
 
3661
3663
  if (typeof lastList !== "undefined") {
3662
3664
  this.getTrackListFromYandexDisk(lastList);
@@ -3673,6 +3675,10 @@ class WinampTelegramCustomHandler {
3673
3675
  this.initializeTelegramWebAppEvents();
3674
3676
  }
3675
3677
 
3678
+ this.webamp.__onStateChange(() => {
3679
+ this.updateAppState();
3680
+ });
3681
+
3676
3682
  this.initializeApplicationHandlers();
3677
3683
  }
3678
3684
  }, 1000);
@@ -3709,11 +3715,6 @@ class WinampTelegramCustomHandler {
3709
3715
  open: false
3710
3716
  });
3711
3717
  const ev = ['ended', 'playing', 'timeupdate', 'fileLoaded', 'waiting', 'stopWaiting'];
3712
-
3713
- this.webamp.__onStateChange(() => {
3714
- this.updateAppState();
3715
- });
3716
-
3717
3718
  ev.forEach(ev => this.webamp.media.on(ev, () => {
3718
3719
  this.updateAppState();
3719
3720
  }));