aboutsummaryrefslogtreecommitdiffstats
path: root/src/web
diff options
context:
space:
mode:
authorNick Hawke <n.hawke96@gmail.com>2024-09-11 23:32:28 -0400
committerNick Hawke <n.hawke96@gmail.com>2024-09-11 23:39:38 -0400
commit253c0043d00adb4dffb7f871c3a4ddef810e3967 (patch)
tree1a6e03358a37704091b8a04984ebd3b13c01faf8 /src/web
parent4eb5d222e083effe7d87bb3a30d2d64ca4094d75 (diff)
downloadslskd-253c0043d00adb4dffb7f871c3a4ddef810e3967.tar.gz
Fix eslint warnings
Diffstat (limited to 'src/web')
-rw-r--r--src/web/src/components/App.jsx27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/web/src/components/App.jsx b/src/web/src/components/App.jsx
index 7796cb1c..5c82697a 100644
--- a/src/web/src/components/App.jsx
+++ b/src/web/src/components/App.jsx
@@ -149,8 +149,8 @@ class App extends Component {
'change',
(event) => event.matches && this.setState({ theme: 'light' }),
);
-
}
+
this.init();
}
@@ -188,9 +188,9 @@ class App extends Component {
await appHub.start();
}
- let savedTheme = this.getSavedTheme();
+ const savedTheme = this.getSavedTheme();
if (savedTheme != null) {
- this.setState({theme: savedTheme});
+ this.setState({ theme: savedTheme });
}
this.setState({
@@ -206,15 +206,15 @@ class App extends Component {
};
getSavedTheme = () => {
- return localStorage.getItem("slskd-theme");
+ return localStorage.getItem('slskd-theme');
};
toggleTheme = () => {
this.setState((state) => {
- let newTheme = state.theme === 'dark' ? 'light' : 'dark';
- localStorage.setItem("slskd-theme", newTheme);
- return {theme: newTheme}
- })
+ const newTheme = state.theme === 'dark' ? 'light' : 'dark';
+ localStorage.setItem('slskd-theme', newTheme);
+ return { theme: newTheme };
+ });
};
handleLogin = (username, password, rememberMe) => {
@@ -258,9 +258,10 @@ class App extends Component {
initialized,
login,
retriesExhausted,
- theme = this.getSavedTheme() || (window.matchMedia('(prefers-color-scheme: dark)').matches
- ? 'dark'
- : 'light'),
+ theme = this.getSavedTheme() ||
+ (window.matchMedia('(prefers-color-scheme: dark)').matches
+ ? 'dark'
+ : 'light'),
} = this.state;
const {
pendingReconnect,
@@ -403,9 +404,7 @@ class App extends Component {
className="right"
inverted
>
- <Menu.Item
- onClick={() => this.toggleTheme()}
- >
+ <Menu.Item onClick={() => this.toggleTheme()}>
<Icon name="theme" />
Theme
</Menu.Item>