Skip to content

Commit

Permalink
fix this
Browse files Browse the repository at this point in the history
  • Loading branch information
srt32 authored May 24, 2024
1 parent a8f6b09 commit 9dc10b4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/auto-check-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function setLoadingState(event: Event) {
const state = states.get(autoCheckElement)

// If some attributes are missing we want to exit early and make sure that the element is valid.
if (!src || (httpMethod === 'POST' && !csrf) || !state) {
if (!src || (this.httpMethod === 'POST' && !csrf) || !state) {

Check failure on line 197 in src/auto-check-element.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected 'this'
return
}

Expand Down Expand Up @@ -244,7 +244,7 @@ async function check(autoCheckElement: AutoCheckElement) {
const state = states.get(autoCheckElement)

// If some attributes are missing we want to exit early and make sure that the element is valid.
if (!src || (httpMethod === 'POST' && !csrf) || !state) {
if (!src || (this.httpMethod === 'POST' && !csrf) || !state) {

Check failure on line 247 in src/auto-check-element.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected 'this'
if (autoCheckElement.required) {
input.setCustomValidity('')
}
Expand All @@ -259,12 +259,12 @@ async function check(autoCheckElement: AutoCheckElement) {
}

const body = new FormData()
if (httpMethod === 'POST') {
if (this.httpMethod === 'POST') {

Check failure on line 262 in src/auto-check-element.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected 'this'
body.append(csrfField, csrf)
body.append('value', input.value)
} else {
url = new URL(src, window.location.origin)
url.search = new URLSearchParams({value: input.value}).toString()
this.url = new URL(src, window.location.origin)

Check failure on line 266 in src/auto-check-element.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected 'this'
this.url.search = new URLSearchParams({value: input.value}).toString()

Check failure on line 267 in src/auto-check-element.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected 'this'
}

input.dispatchEvent(new AutoCheckSendEvent(body))
Expand All @@ -281,7 +281,7 @@ async function check(autoCheckElement: AutoCheckElement) {
const response = await fetchWithNetworkEvents(autoCheckElement, src, {
credentials: 'same-origin',
signal: state.controller.signal,
method: httpMethod,
method: this.httpMethod,

Check failure on line 284 in src/auto-check-element.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected 'this'
body,
})
if (response.ok) {
Expand Down

0 comments on commit 9dc10b4

Please sign in to comment.