Fixed types when comparing client id-s first character

This commit is contained in:
MrFry 2020-04-10 17:01:53 +02:00
parent 0baf5df7d4
commit eacd72f2ba

View file

@ -21,7 +21,7 @@
// ==UserScript==
// @name Moodle/Elearning/KMOOC test help
// @version 2.0.1.4
// @version 2.0.1.5
// @description Online Moodle/Elearning/KMOOC test help
// @author MrFry
// @match https://elearning.uni-obuda.hu/main/*
@ -1576,8 +1576,9 @@
loginInput.type = 'text'
loginInput.style.width = '400px'
loginInput.style.textAlign = 'center'
if (getVal('clientId') && getVal('clientId')[0] !== 0) {
loginInput.value = getVal('clientId') || ''
const clientId = getVal('clientId')
if (clientId && clientId.toString()[0] !== '0') {
loginInput.value = clientId || ''
}
loginDiv.appendChild(loginInput)
loginDiv.appendChild(loginButton)
@ -1585,8 +1586,8 @@
SetStyle(loginButton, buttonStyle)
loginButton.addEventListener('click', function () {
if (loginInput.value === getVal('clientId').toString()) {
openInTab(serverAdress + 'getVeteranPw?cid=' + getVal('clientId'), {
if (loginInput.value === clientId.toString()) {
openInTab(serverAdress + 'getVeteranPw?cid=' + clientId, {
active: true
})
} else {