From 51d7577665255b3ff169c2748df4153b4b0af574 Mon Sep 17 00:00:00 2001 From: Jade Date: Sun, 18 Jan 2026 17:52:49 +0100 Subject: [PATCH 1/2] feat: add button to download APK --- app/Components/Area_sidebar.tsx | 11 +++++++++++ app/Services/page.tsx | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Components/Area_sidebar.tsx b/app/Components/Area_sidebar.tsx index a94d77b..d221ab8 100644 --- a/app/Components/Area_sidebar.tsx +++ b/app/Components/Area_sidebar.tsx @@ -16,6 +16,13 @@ export default function Sidebar({ isOpen = true, onClose }: SidebarProps) { const [userRole, setUserRole] = useState(null); const [loading, setLoading] = useState(true); + const downloadAPK = async () => { + const link = document.createElement('a'); + link.href = '/APK/app-release.apk'; + link.download = 'app-release.apk'; + link.click(); + }; + const getUserId = async () => { try { const token = localStorage.getItem("authToken"); @@ -129,6 +136,10 @@ export default function Sidebar({ isOpen = true, onClose }: SidebarProps) { )} + ); } \ No newline at end of file diff --git a/app/Services/page.tsx b/app/Services/page.tsx index 9f4940a..d3c1dc1 100644 --- a/app/Services/page.tsx +++ b/app/Services/page.tsx @@ -76,7 +76,6 @@ export default function ServicesPage() { throw new Error("Failed to fetch services status"); } const data = await response.json(); - console.log("Fetched services status:", data); setServicesStatus(data || []); return data; } catch (err) { From 61a72e49e037861b873387b0a6102512f8d73fde Mon Sep 17 00:00:00 2001 From: Yuuko Date: Sun, 18 Jan 2026 18:38:57 +0100 Subject: [PATCH 2/2] fix: apk download --- app/Components/Area_sidebar.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/Components/Area_sidebar.tsx b/app/Components/Area_sidebar.tsx index d221ab8..d172def 100644 --- a/app/Components/Area_sidebar.tsx +++ b/app/Components/Area_sidebar.tsx @@ -17,10 +17,12 @@ export default function Sidebar({ isOpen = true, onClose }: SidebarProps) { const [loading, setLoading] = useState(true); const downloadAPK = async () => { - const link = document.createElement('a'); - link.href = '/APK/app-release.apk'; - link.download = 'app-release.apk'; + const link = document.createElement("a"); + link.href = "/client.apk"; + link.download = "area-client.apk"; + document.body.appendChild(link); link.click(); + document.body.removeChild(link); }; const getUserId = async () => { @@ -84,9 +86,7 @@ export default function Sidebar({ isOpen = true, onClose }: SidebarProps) { }; if (loading) { - return ( -
- ); + return
; } return ( @@ -136,10 +136,12 @@ export default function Sidebar({ isOpen = true, onClose }: SidebarProps) { )} -
); -} \ No newline at end of file +}