Skip to content

Commit

Permalink
Reset nick colours on theme change
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsOnlyBinary committed Nov 7, 2023
1 parent 09347f3 commit cbd0165
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export default {
this.listen(this.$state, 'theme.change', () => {
this.themeUrl = ThemeManager.themeUrl(themes.currentTheme());
this.$nextTick(() => cssVarsPonyfill());
this.$state.clearNickColours();
});
},
initStateBrowser() {
Expand Down
8 changes: 8 additions & 0 deletions src/libs/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,14 @@ function createNewState() {
return buffers;
},

clearNickColours() {
this.networks.forEach((network) => {
Object.values(network.users).forEach((user) => {
user.colour = '';
});
});
},

changeUserNick(networkid, oldNick, newNick) {
let network = this.getNetwork(networkid);
if (!network) {
Expand Down
4 changes: 4 additions & 0 deletions static/themes/nightswatch/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
--comp-border: #444;
}

.kiwi-wrap {
--kiwi-nickcolour-lightness: 50;
}

/* Welcome */
.kiwi-welcome-simple-form .u-submit {
color: #fff;
Expand Down

0 comments on commit cbd0165

Please sign in to comment.