mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
chore(style): use eqeqeq
(#1013)
This commit is contained in:
parent
108fdc174f
commit
ca13247572
@ -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",
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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 => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user