@triptease/tt-navbar 0.0.41 → 0.0.42

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @triptease/tt-navbar v0.0.41
2
+ * @triptease/tt-navbar v0.0.42
3
3
  */
4
4
 
5
5
  // ../../node_modules/@lit/reactive-element/css-tag.js
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @triptease/tt-navbar v0.0.41
2
+ * @triptease/tt-navbar v0.0.42
3
3
  */
4
4
 
5
5
  // src/triptease-logo.ts
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @triptease/tt-navbar v0.0.41
2
+ * @triptease/tt-navbar v0.0.42
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -2035,12 +2035,22 @@ var NavbarController = class {
2035
2035
  }
2036
2036
  hostUpdate() {
2037
2037
  if (!this._hasInitialized && window.Clerk) {
2038
- const userSetting = window.Clerk.user?.unsafeMetadata?.preferences?.ui?.navigationOpen;
2039
- if (userSetting !== void 0) {
2040
- this._isOpen = userSetting;
2041
- this._hasInitialized = true;
2042
- this.host.requestUpdate();
2043
- }
2038
+ this._removeClerkListener = window.Clerk.addListener((resources) => {
2039
+ const { user: user2 } = resources;
2040
+ if (user2 && !this._hasInitialized) {
2041
+ const navigationOpen = user2.unsafeMetadata?.preferences?.ui?.navigationOpen;
2042
+ if (navigationOpen !== void 0) {
2043
+ this._isOpen = navigationOpen;
2044
+ this.host.requestUpdate();
2045
+ }
2046
+ this._hasInitialized = true;
2047
+ }
2048
+ });
2049
+ }
2050
+ }
2051
+ hostDisconnected() {
2052
+ if (this._removeClerkListener) {
2053
+ this._removeClerkListener();
2044
2054
  }
2045
2055
  }
2046
2056
  async toggle() {