diff --git a/kinode/packages/app-store/app-store/src/lib.rs b/kinode/packages/app-store/app-store/src/lib.rs index a2765426e..51961d9ef 100644 --- a/kinode/packages/app-store/app-store/src/lib.rs +++ b/kinode/packages/app-store/app-store/src/lib.rs @@ -331,10 +331,7 @@ fn handle_local_request( ( match utils::uninstall(our, state, &process_lib_package_id) { Ok(()) => { - println!( - "successfully uninstalled package {}", - &process_lib_package_id - ); + println!("successfully uninstalled package {process_lib_package_id}"); // TODO handle? let _ = Request::to(("our", "chain", "app-store", "sys")) .body( @@ -345,10 +342,7 @@ fn handle_local_request( LocalResponse::UninstallResponse(UninstallResponse::Success) } Err(e) => { - println!( - "error uninstalling package {}: {e}", - &process_lib_package_id - ); + println!("error uninstalling package {process_lib_package_id}: {e}"); LocalResponse::UninstallResponse(UninstallResponse::Failure) } }, diff --git a/kinode/packages/app-store/ui/src/pages/AppPage.tsx b/kinode/packages/app-store/ui/src/pages/AppPage.tsx index 61742d661..5becb67ed 100644 --- a/kinode/packages/app-store/ui/src/pages/AppPage.tsx +++ b/kinode/packages/app-store/ui/src/pages/AppPage.tsx @@ -40,6 +40,7 @@ export default function AppPage() { const [showCapApproval, setShowCapApproval] = useState(false); const [manifestResponse, setManifestResponse] = useState(null); const [isPolling, setIsPolling] = useState(false); + const [canLaunch, setCanLaunch] = useState(false); const appDownloads = useMemo(() => downloads[id || ""] || [], [downloads, id]); @@ -98,6 +99,11 @@ export default function AppPage() { setApp(appData); setInstalledApp(installedAppData); + if (appData) { + await fetchHomepageApps(); + setCanLaunch(!!getLaunchUrl(`${appData.package_id.package_name}:${appData.package_id.publisher_node}`)); + } + if (appData?.metadata?.properties?.code_hashes) { const versions = appData.metadata.properties.code_hashes; if (versions.length > 0) { @@ -216,11 +222,6 @@ export default function AppPage() { } }, [app, getLaunchUrl]); - const canLaunch = useMemo(() => { - if (!app) return false; - return !!getLaunchUrl(`${app.package_id.package_name}:${app.package_id.publisher_node}`); - }, [app, getLaunchUrl]); - const handleUninstall = async () => { if (!app) return; setIsUninstalling(true);