가상매매 시간봉 제거
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Capacitor } from '@capacitor/core';
|
||||
import { App } from '@capacitor/app';
|
||||
|
||||
/** 네이티브: build.gradle versionName / versionCode · 웹: dev */
|
||||
export function useAppVersion(): string {
|
||||
const [label, setLabel] = useState('…');
|
||||
|
||||
useEffect(() => {
|
||||
void (async () => {
|
||||
if (Capacitor.isNativePlatform()) {
|
||||
try {
|
||||
const { version, build } = await App.getInfo();
|
||||
setLabel(build ? `${version} (build ${build})` : version);
|
||||
return;
|
||||
} catch {
|
||||
/* fallback */
|
||||
}
|
||||
}
|
||||
setLabel(
|
||||
(import.meta as ImportMeta & { env?: { VITE_APP_VERSION?: string } }).env
|
||||
?.VITE_APP_VERSION ?? 'web',
|
||||
);
|
||||
})();
|
||||
}, []);
|
||||
|
||||
return label;
|
||||
}
|
||||
Reference in New Issue
Block a user