1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-02-20 20:51:49 +01:00
upscayl/renderer/components/hooks/use-upscayl-version.ts
2024-09-24 20:05:33 +05:30

17 lines
362 B
TypeScript

import { useState, useEffect } from "react";
const useUpscaylVersion = () => {
const [version, setVersion] = useState<string | null>(null);
useEffect(() => {
const upscaylVersion = navigator?.userAgent?.match(
/Upscayl\/([\d\.]+\d+)/,
)?.[1];
setVersion(upscaylVersion);
}, []);
return version;
};
export default useUpscaylVersion;