Skip to content

Commit

Permalink
fix: revert withThemeStyles change
Browse files Browse the repository at this point in the history
  • Loading branch information
joshhowenstine committed Nov 17, 2023
1 parent e367bd7 commit dcf1c01
Showing 1 changed file with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ export default function withThemeStyles(Base, mixinStyle = {}) {
this._updatePropDefaults();
this.queueThemeUpdate();
});

this._whenEnabled = new Promise(resolve => {
this._whenEnabledResolver = resolve;
});

this._withThemeStylesSetupComplete = true;
}

Expand All @@ -75,14 +70,6 @@ export default function withThemeStyles(Base, mixinStyle = {}) {
}
}

_firstEnable() {
this._readyForUpdates = true;
this._whenEnabledResolver();
updateManager.deleteRequestUpdate(this);
this.queueThemeUpdate();
super._firstEnable && super._firstEnable();
}

_updatePropDefaults() {
// Add support for properties passed through the theme
const componentConfigProps = this._styleManager.props || {};
Expand Down Expand Up @@ -181,15 +168,13 @@ export default function withThemeStyles(Base, mixinStyle = {}) {
* @returns {void}
*/
_updateThemeComponent() {
if (this._readyForUpdates) {
if (!this.style) return;
if (!this._isAttached()) return;
this._checkDimensionUpdates();
this.queueRequestUpdate
? this.queueRequestUpdate()
: this._update && this._update();
this._updateItemLayout && this._updateItemLayout();
}
if (!this.style) return;
if (!this._isAttached()) return;
this._checkDimensionUpdates();
this.queueRequestUpdate
? this.queueRequestUpdate()
: this._update && this._update();
this._updateItemLayout && this._updateItemLayout();
}

/**
Expand Down Expand Up @@ -367,4 +352,4 @@ export default function withThemeStyles(Base, mixinStyle = {}) {
this._styleManager.update();
}
};
}
}

Check failure on line 355 in packages/@lightningjs/ui-components/src/mixins/withThemeStyles/index.js

View workflow job for this annotation

GitHub Actions / quality / lint-unit

Insert `⏎`

0 comments on commit dcf1c01

Please sign in to comment.