sup guys, i have one problem:
async function isInstalled(clientName: string): Promise<boolean> {
return await invoke("is_installed", { client: clientName });
}
(async() => {
console.log(await isInstalled("fold_name"));
})(); // prints false
function isInstalled() {
const [installed, setInstalled] = useState<boolean | null>(null);
useEffect(() => {
const checkInstallation = async () => {
console.log("i'am here");
const result = await isInstalled("fold_name");
setInstalled(result);
console.log("result:", result);
};
checkInstallation();
}, []);
return (
<>
<p>{installed ? "yep" : "no"}</p>
<>
)
} // prints only i'am here