app_store UI: reload our_apps after publishing a new one

This commit is contained in:
bitful-pannul 2024-12-11 16:35:36 +02:00
parent cdd04f12f9
commit 825e04ea2b

View File

@ -41,6 +41,18 @@ export default function PublishPage() {
}
}, [packageName, publisherId, fetchDownloadsForApp]);
useEffect(() => {
if (isConfirmed) {
// Fetch our apps again after successful publish
fetchOurApps();
// Reset form fields
setPackageName("");
setPublisherId(window.our?.node || "");
setMetadataUrl("");
setMetadataHash("");
}
}, [isConfirmed, fetchOurApps]);
const validatePackageName = useCallback((name: string) => {
// Allow lowercase letters, numbers, hyphens, and dots
const validNameRegex = /^[a-z0-9.-]+$/;
@ -173,12 +185,6 @@ export default function PublishPage() {
gas: BigInt(1000000),
});
// Reset form fields
setPackageName("");
setPublisherId(window.our?.node || "");
setMetadataUrl("");
setMetadataHash("");
} catch (error) {
console.error(error);
}