@exezt-/webamp 1.5.0-0x602 → 1.5.0-0x603

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.
@@ -14793,6 +14793,8 @@ function selectAll() {
14793
14793
 
14794
14794
  class webamp_telegram_handler_WinampTelegramCustomHandler {
14795
14795
  constructor() {
14796
+ var _window, _window$Telegram, _window2, _window2$Telegram;
14797
+
14796
14798
  defineProperty_default()(this, "webamp", void 0);
14797
14799
 
14798
14800
  defineProperty_default()(this, "telegram", void 0);
@@ -14828,15 +14830,13 @@ class webamp_telegram_handler_WinampTelegramCustomHandler {
14828
14830
  console.info(`File ${item.name} can't be loaded due oversize`);
14829
14831
  } else {
14830
14832
  await fetch(item.file).then(response => response).then(resp => fetch(resp.url)).then(async response => {
14831
- // if (response.status === 302) {
14832
- // return await fetch(response.headers.get('Location' as string)!, {
14833
- // headers: [
14834
- // ['Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'],
14835
- // ['Content-Type', 'application/octet-stream'],
14836
- // ]
14837
- // })
14838
- // } else {
14839
- return response; // }
14833
+ if (response.status === 302) {
14834
+ return await fetch(response.headers.get('Location'), {
14835
+ headers: [['Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'], ['Content-Type', 'application/octet-stream']]
14836
+ });
14837
+ } else {
14838
+ return response;
14839
+ }
14840
14840
  }).then(res => {
14841
14841
  var _res$body;
14842
14842
 
@@ -14956,21 +14956,14 @@ class webamp_telegram_handler_WinampTelegramCustomHandler {
14956
14956
  }
14957
14957
  });
14958
14958
 
14959
- const lastList = this.getCookie('lastlist');
14959
+ const lastList = this.getCookie('lastlist'); // @ts-ignore | because no global var telegram avail in project types
14960
+
14961
+ this.telegram = (_window = window) === null || _window === void 0 ? void 0 : (_window$Telegram = _window.Telegram) === null || _window$Telegram === void 0 ? void 0 : _window$Telegram.WebApp;
14960
14962
 
14961
14963
  if (typeof lastList !== "undefined") {
14962
14964
  this.getFiles(lastList);
14963
14965
  }
14964
14966
 
14965
- this.initialize();
14966
- }
14967
-
14968
- initialize() {
14969
- var _window, _window$Telegram, _window2, _window2$Telegram;
14970
-
14971
- // @ts-ignore | because no global var telegram avail in project types
14972
- this.telegram = (_window = window) === null || _window === void 0 ? void 0 : (_window$Telegram = _window.Telegram) === null || _window$Telegram === void 0 ? void 0 : _window$Telegram.WebApp;
14973
-
14974
14967
  if (!window.__webamp) {
14975
14968
  throw new Error("Webamp __webamp is undefined!!");
14976
14969
  } // @ts-ignore | because no global var telegram avail in project types
@@ -14980,7 +14973,9 @@ class webamp_telegram_handler_WinampTelegramCustomHandler {
14980
14973
  console.error("Telegram is undefined!! Skipping Telegram.WebApp event handler...");
14981
14974
  }
14982
14975
 
14983
- if (typeof localStorage.getItem('app-state') !== "undefined") this.loadOptions(JSON.parse(localStorage.getItem('app-state')));
14976
+ if (typeof localStorage.getItem('app-state') !== "undefined") {
14977
+ this.loadOptions(JSON.parse(localStorage.getItem('app-state')));
14978
+ }
14984
14979
 
14985
14980
  window.__webamp.onTrackDidChange(() => {
14986
14981
  this.updateAppState();