saltfish 0.2.70 → 0.2.71

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.
@@ -1419,6 +1419,12 @@ const saltfishStore = createStore()(
1419
1419
  state.backendPlaylists = playlists;
1420
1420
  });
1421
1421
  },
1422
+ // Set admin flag from backend
1423
+ setIsAdmin: (isAdmin) => {
1424
+ set2((state) => {
1425
+ state.isAdmin = isAdmin;
1426
+ });
1427
+ },
1422
1428
  completePlaylist: () => {
1423
1429
  set2((state) => {
1424
1430
  state.currentState = transitionState({ type: "COMPLETE_PLAYLIST" });
@@ -1767,7 +1773,7 @@ __publicField(ErrorHandler, "DEFAULT_OPTIONS", {
1767
1773
  shouldTriggerEvent: false,
1768
1774
  shouldDestroy: false
1769
1775
  });
1770
- const VERSION = "0.2.70";
1776
+ const VERSION = "0.2.71";
1771
1777
  class PlayerInitializationService {
1772
1778
  constructor(managers) {
1773
1779
  __publicField(this, "managers");
@@ -1834,8 +1840,8 @@ class PlayerInitializationService {
1834
1840
  const store = useSaltfishStore.getState();
1835
1841
  store.initialize(updatedConfig);
1836
1842
  this.managers.analyticsManager.initialize(config, this.managers.sessionManager.getSessionId());
1837
- if (data.isAdmin) {
1838
- store.isAdmin = true;
1843
+ if (data.isAdmin && store.setIsAdmin) {
1844
+ store.setIsAdmin(true);
1839
1845
  log("[PlayerInitializationService.initialize] Admin token detected");
1840
1846
  }
1841
1847
  if (data.playlists && Array.isArray(data.playlists) && store.setBackendPlaylists) {
@@ -10716,7 +10722,7 @@ const SaltfishPlayer$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
10716
10722
  __proto__: null,
10717
10723
  SaltfishPlayer
10718
10724
  }, Symbol.toStringTag, { value: "Module" }));
10719
- const version = "0.2.70";
10725
+ const version = "0.2.71";
10720
10726
  const packageJson = {
10721
10727
  version
10722
10728
  };