chore(style): use eqeqeq (#1013)

This commit is contained in:
q1anx1 2022-08-13 11:23:16 +08:00 committed by GitHub
parent 108fdc174f
commit ca13247572
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 9 deletions

View File

@ -89,9 +89,8 @@
"no-unused-vars": "off",
"react/no-deprecated": "error",
"react/jsx-key": "error",
// TODO(qianxi): should be error
"no-console": "error",
"eqeqeq": "warn",
"eqeqeq": "error",
"react/prop-types": "off",
"react/display-name": "off",

View File

@ -164,7 +164,7 @@ class LoginPage extends React.Component {
} else {
// OAuth
const oAuthParams = Util.getOAuthGetParameters();
if (oAuthParams !== null && oAuthParams.responseType != null && oAuthParams.responseType !== "") {
if (oAuthParams !== null && oAuthParams.responseType !== null && oAuthParams.responseType !== "") {
values["type"] = oAuthParams.responseType;
} else {
values["type"] = this.state.type;
@ -175,11 +175,11 @@ class LoginPage extends React.Component {
values["samlRequest"] = oAuthParams.samlRequest;
}
if (values["samlRequest"] != null && values["samlRequest"] !== "") {
if (values["samlRequest"] !== null && values["samlRequest"] !== "" && values["samlRequest"] !== undefined) {
values["type"] = "saml";
}
if (this.state.owner != null) {
if (this.state.owner !== null) {
values["organization"] = this.state.owner;
}

View File

@ -582,7 +582,7 @@ class SignupPage extends React.Component {
  {i18next.t("signup:Have account?")} 
<a onClick={() => {
const linkInStorage = sessionStorage.getItem("signinUrl");
if(linkInStorage != null) {
if(linkInStorage !== null && linkInStorage !== "") {
Setting.goToLink(linkInStorage);
}else{
Setting.goToLogin(this, application);

View File

@ -35,7 +35,7 @@ const resources = {
function initLanguage() {
let language = localStorage.getItem("language");
if (language === undefined || language == null) {
if (language === undefined || language === null || language === "") {
if (Conf.ForceLanguage !== "") {
language = Conf.ForceLanguage;
} else {

View File

@ -75,7 +75,7 @@ function registerValidSW(swUrl, config) {
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
if (installingWorker === null) {
return;
}
installingWorker.onstatechange = () => {
@ -126,7 +126,7 @@ function checkValidServiceWorker(swUrl, config) {
const contentType = response.headers.get("content-type");
if (
response.status === 404 ||
(contentType != null && contentType.indexOf("javascript") === -1)
(contentType !== null && contentType.indexOf("javascript") === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {