Skip to content

Conversation

@Embotic-Wayne
Copy link
Collaborator

@Embotic-Wayne Embotic-Wayne commented Jan 3, 2026

step 2

@adarshm11
Copy link
Contributor

you spelled permission wrong

@Embotic-Wayne Embotic-Wayne changed the title permsision request button for led sign page permission request button for led sign page Jan 9, 2026
@Embotic-Wayne
Copy link
Collaborator Author

image

}, [])

if (loading) {
if (loading || checkingPermission) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we can skip the second checkingPermission check, so the page loads as soon as the healthcheck is done

renderPermissionRequestUI can have the checkingPermission check instead, and it can have some small message like "loading", and then fade in the result (requested already or not yet)

Comment on lines 16 to 23
if (res.ok) {
const data = await res.json();
status.responseData = Array.isArray(data) && data.length > 0 ? data[0] : null;
} else if (res.status === 404) {
status.responseData = null;
} else {
status.error = true;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should work

Suggested change
if (res.ok) {
const data = await res.json();
status.responseData = Array.isArray(data) && data.length > 0 ? data[0] : null;
} else if (res.status === 404) {
status.responseData = null;
} else {
status.error = true;
}
status.error = !!res.ok;
if (res.ok) {
const data = await res.json();
status.responseData = Array.isArray(data) && data.length > 0 ? data[0] : null;
}

Comment on lines 46 to 56
if (res.ok) {
// Backend sends 200 with no body on success, so fetch the created request
const existingRequest = await getPermissionRequest(type, token);
status.responseData = existingRequest.responseData;
} else if (res.status === 409) {
// If conflict, fetch the existing request
const existingRequest = await getPermissionRequest(type, token);
status.responseData = existingRequest.responseData;
} else {
status.error = true;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this work

Suggested change
if (res.ok) {
// Backend sends 200 with no body on success, so fetch the created request
const existingRequest = await getPermissionRequest(type, token);
status.responseData = existingRequest.responseData;
} else if (res.status === 409) {
// If conflict, fetch the existing request
const existingRequest = await getPermissionRequest(type, token);
status.responseData = existingRequest.responseData;
} else {
status.error = true;
}
status.error = !!res.ok;
if (res.ok || res.status === 409) {
// Backend sends 200 with no body on success, so fetch the created request
const existingRequest = await getPermissionRequest(type, token);
status.responseData = existingRequest.responseData;
}

Comment on lines 299 to 301
<p className="text-sm text-gray-600 dark:text-gray-400 italic">
Drop a message in Discord to speed up the process
</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p className="text-sm text-gray-600 dark:text-gray-400 italic">
Drop a message in Discord to speed up the process
</p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants