mirror of
https://github.com/upscayl/upscayl.git
synced 2024-12-20 19:35:52 +01:00
17 lines
362 B
TypeScript
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;
|