fix console errors

This commit is contained in:
chark1es 2025-02-18 01:35:42 -08:00
parent 0bea38eebb
commit 3330273fbf
2 changed files with 36 additions and 42 deletions

View file

@ -247,29 +247,9 @@ const EventCheckIn = () => {
<label className="label">
<span className="label-text">Enter event code to check in</span>
</label>
<div className="flex gap-2">
<input
type="password"
placeholder="Enter code"
className="input input-bordered flex-1"
onKeyPress={(e) => {
if (e.key === "Enter") {
<form onSubmit={(e) => {
e.preventDefault();
const input = e.target as HTMLInputElement;
if (input.value.trim()) {
setIsLoading(true);
handleEventCheckIn(input.value.trim()).finally(() => {
setIsLoading(false);
input.value = "";
});
}
}
}}
/>
<button
className={`btn btn-primary min-w-[90px] ${isLoading ? "loading" : ""}`}
onClick={(e) => {
const input = e.currentTarget.previousElementSibling as HTMLInputElement;
const input = e.currentTarget.querySelector('input') as HTMLInputElement;
if (input.value.trim()) {
setIsLoading(true);
handleEventCheckIn(input.value.trim()).finally(() => {
@ -279,7 +259,21 @@ const EventCheckIn = () => {
} else {
createToast("Please enter an event code", "warning");
}
}}>
<div className="flex gap-2">
<input
type="password"
placeholder="Enter code"
className="input input-bordered flex-1"
onKeyPress={(e) => {
if (e.key === "Enter") {
e.preventDefault();
}
}}
/>
<button
type="submit"
className={`btn btn-primary min-w-[90px] ${isLoading ? "loading" : ""}`}
disabled={isLoading}
>
{isLoading ? (
@ -289,6 +283,7 @@ const EventCheckIn = () => {
)}
</button>
</div>
</form>
</div>
</div>
</div>

View file

@ -232,7 +232,6 @@ export default function Attendees() {
let isMounted = true;
const fetchEventData = async () => {
if (!eventId || !auth.isAuthenticated()) {
if (!eventId) console.log('No eventId provided');
if (!auth.isAuthenticated()) {
console.log('User not authenticated');
setError('Authentication required');