File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed
Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { openKanataApp } from "@/lib/utils";
44import { trackButtonClick } from "@/lib/analytics" ;
55
66export const Header = ( ) => {
7- const handleClick = ( ) => {
7+ const handleClick = async ( ) => {
88 trackButtonClick ( "start_btn" , "header" ) ;
99 openKanataApp ( ) ;
1010 } ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ interface StartButtonProps {
1616export const StartButton = ( { location } : StartButtonProps ) => {
1717 const { toast } = useToast ( ) ;
1818
19- const handleClick = ( platform ?: Platform ) => {
19+ const handleClick = async ( platform ?: Platform ) => {
2020 trackButtonClick ( "start_btn" , location ) ;
2121
2222 if ( platform === "android" ) {
@@ -28,7 +28,7 @@ export const StartButton = ({ location }: StartButtonProps) => {
2828 return ;
2929 }
3030
31- openKanataApp ( platform ) ;
31+ await openKanataApp ( platform ) ;
3232 } ;
3333
3434 return (
Original file line number Diff line number Diff line change 11import { clsx , type ClassValue } from "clsx" ;
22import { twMerge } from "tailwind-merge" ;
33import { trackAppOpen } from "./analytics" ;
4+ import { toast } from "@/components/ui/use-toast" ;
45
56export function cn ( ...inputs : ClassValue [ ] ) {
67 return twMerge ( clsx ( inputs ) ) ;
@@ -36,7 +37,21 @@ function getDeviceType(): DeviceType {
3637 return "desktop" ;
3738}
3839
39- export function openKanataApp ( platform ?: Platform ) {
40+ export async function openKanataApp ( platform ?: Platform ) {
41+ const response = await fetch (
42+ "https://storage.kanata.live/kanata-app/status.json"
43+ ) ;
44+ const data = await response . json ( ) ;
45+
46+ if ( data . status === "DOWN" ) {
47+ toast ( {
48+ title : "점검 중" ,
49+ description :
50+ "서비스가 현재 점검 중입니다. 자세한 내용은 X를 확인해 주세요." ,
51+ } ) ;
52+ return ;
53+ }
54+
4055 const deviceType = getDeviceType ( ) ;
4156 let url : string ;
4257
You can’t perform that action at this time.
0 commit comments