Skip to content

Commit

Permalink
Fix settings-aboutme to wait for icon load before coloring.
Browse files Browse the repository at this point in the history
  • Loading branch information
UtkarshSiddhpura committed Jul 30, 2024
1 parent e225221 commit 15239d3
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions v2/js/screens/settings-aboutme.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,18 @@ const AboutMe = {
},

colorize() {
this.$refs.psicon.colorData = this.getPreviousStrokeColor(this.currentcolor);
this.$refs.pficon.colorData = this.getPreviousFillColor(this.currentcolor);
this.$refs.cicon.colorData = this.currentcolor;
this.$refs.nficon.colorData = this.getNextFillColor(this.currentcolor);
this.$refs.nsicon.colorData = this.getNextStrokeColor(this.currentcolor);
const icons = ['psicon', 'pficon', 'cicon', 'nficon', 'nsicon'];
const colorFunctions = [
this.getPreviousStrokeColor,
this.getPreviousFillColor,
color => color,
this.getNextFillColor,
this.getNextStrokeColor
];
icons.forEach(async (icon, index) => {
await this.$refs[icon].wait();
this.$refs[icon].colorData = colorFunctions[index](this.currentcolor);
});
},

getNextStrokeColor(color) {
Expand Down

0 comments on commit 15239d3

Please sign in to comment.