Skip to content

Commit

Permalink
fix(style): fix sonar cube errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nurikk committed Nov 24, 2021
1 parent 99c3f20 commit f885e18
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/components/device-page/tree.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
padding: 5px 10px;
text-decoration: none;
color: #666;
font-family: arial, verdana, tahoma;
font-size: 11px;
border-radius: 5px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BodyEnd extends React.Component {
super(props);
this.el = document.createElement('div');

'modal-backdrop fade show'.split(' ').map(className => this.el.classList.add(className));
'modal-backdrop fade show'.split(' ').forEach(className => this.el.classList.add(className));
}

componentDidMount() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/settings/stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { useTranslation } from "react-i18next";
import { GlobalState } from "../../store";
import orderBy from "lodash/orderBy";
import { powerSourceTypeToTranslationKey } from "../power-source";
type StatsProps = Pick<GlobalState, 'devices'> & {

}
type StatsProps = Pick<GlobalState, 'devices'>;

export function Stats(props: StatsProps) {
const { devices } = props;
const { t } = useTranslation(["stats", "zigbee"]);
Expand Down
7 changes: 6 additions & 1 deletion src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import timeIt from "timeago.js/lib/lang/it";
import timeZh from "timeago.js/lib/lang/zh_TW";
import timeKo from "timeago.js/lib/lang/ko";
import timeCs from "timeago.js/lib/lang/cs";
import { useEffect } from 'react';


register("pl", timePl);
Expand Down Expand Up @@ -86,6 +87,9 @@ const missingKeyHandler = (lngs: string[], ns: string, key: string, fallbackValu
}
}
const debug = process.env.NODE_ENV !== 'production'
i18n.on("languageChanged", (lng: string) => {
document.documentElement.lang = lng;
})
i18n
.use(LanguageDetector)
.use(initReactI18next)
Expand All @@ -96,7 +100,8 @@ i18n
ns: Object.keys(enTranslations),
saveMissing: true,
missingKeyHandler
});
})


const currentLanguage = i18n.language.split('-')[0].toLocaleLowerCase();
if (!resources[currentLanguage]) {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang="en">

<head>
<meta charset="UTF-8" />
Expand Down

0 comments on commit f885e18

Please sign in to comment.