Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

528 B
Raw Blame
import { useState, useEffect } from "react";
import { AppVersionInfo } from "@/models/version.model";

export function useAppVersion() {
  const [version, setVersion] = useState<AppVersionInfo | null>(null);

  useEffect(() => {
    let active = true;

    fetch("/api/version")
      .then((res) => (res.ok ? res.json() : null))
      .then((data: AppVersionInfo | null) => {
        if (active) setVersion(data);
      })
      .catch(() => {});

    return () => {
      active = false;
    };
  }, []);

  return version;
}