gochan-org / gochan

Detected the use of alert, confirm and prompt JS-0052
Anti-pattern
Minor
2 months ago2 years old
58		if(data.responseJSON !== undefined && data.responseJSON.message !== undefined) {
59			alert(`Error updating thread /${board}/${op} lock status: ${data.responseJSON.message}`);
60		} else {
61			alert("Unable to send request: " + xhr);62		}
63	});
64}
56		}
57	}).catch((data: any, _status: any, xhr: any) => {
58		if(data.responseJSON !== undefined && data.responseJSON.message !== undefined) {
59			alert(`Error updating thread /${board}/${op} lock status: ${data.responseJSON.message}`);60		} else {
61			alert("Unable to send request: " + xhr);
62		}
37		url: webroot + "manage/threadattrs",
38		data: data
39	}).then((_data) => {
40		alert("Thread " + (lock?"locked":"unlocked") + " successfully");41		const $lockOpt = $(`select#op${op} option`)
42			.filter((_i, el) => el.textContent === "Lock thread" || el.textContent === "Unlock thread");
43		if(lock) {