fix-bug middle #62

Merged
bagasbanuna merged 2 commits from fix-bug/25-feb-26 into staging 2026-02-25 15:35:21 +08:00
4 changed files with 24 additions and 11 deletions
Showing only changes of commit c6dbd152d5 - Show all commits

View File

@@ -25,6 +25,7 @@ export default function WaitingRoom_View({
const [isLoadingHome, setIsLoadingHome] = useState(false); const [isLoadingHome, setIsLoadingHome] = useState(false);
async function onClickLogout() { async function onClickLogout() {
try {
setLoading(true); setLoading(true);
const res = await fetch(`/api/auth/logout?id=${userLoginId}`, { const res = await fetch(`/api/auth/logout?id=${userLoginId}`, {
method: "GET", method: "GET",
@@ -35,6 +36,11 @@ export default function WaitingRoom_View({
ComponentGlobal_NotifikasiBerhasil(result.message); ComponentGlobal_NotifikasiBerhasil(result.message);
router.push("/", { scroll: false }); router.push("/", { scroll: false });
} }
} catch (error) {
console.error("Error button to home", error);
} finally {
setLoading(false);
}
} }
const [isAccess, setIsAccess] = useState<boolean | null>(null); const [isAccess, setIsAccess] = useState<boolean | null>(null);
@@ -83,7 +89,8 @@ export default function WaitingRoom_View({
</Text> </Text>
<Text fw={"bold"} c={"white"} align="center"> <Text fw={"bold"} c={"white"} align="center">
Harap tunggu, Anda akan menerima pemberitahuan melalui Harap tunggu, Anda akan menerima pemberitahuan melalui
Whatsapp setelah disetujui. Whatsapp setelah disetujui, untuk sementara anda bisa
menunggu pada halaman ini atau keluar.
</Text> </Text>
</Stack> </Stack>
{isAccess && ( {isAccess && (
@@ -110,6 +117,10 @@ export default function WaitingRoom_View({
Home Home
</Button> </Button>
)} )}
<Button color="red" loading={loading} onClick={onClickLogout}>
Keluar
</Button>
</Stack> </Stack>
)} )}
</ComponentGlobal_CardStyles> </ComponentGlobal_CardStyles>

View File

@@ -65,7 +65,7 @@ export const middleware = async (req: NextRequest) => {
const { pathname } = req.nextUrl; const { pathname } = req.nextUrl;
const apiBaseUrl = new URL(req.url).origin || process.env.NEXT_PUBLIC_API_URL; const apiBaseUrl = process.env.NEXT_PUBLIC_API_URL || new URL(req.url).origin;
// Removed excessive logging that was causing high CPU usage // Removed excessive logging that was causing high CPU usage
// const dbUrl = process.env.DATABASE_URL; // const dbUrl = process.env.DATABASE_URL;
// console.log("DATABASE_URL >>", dbUrl); // console.log("DATABASE_URL >>", dbUrl);