mirror of
https://github.com/uqbar-dao/nectar.git
synced 2025-01-02 05:28:22 +03:00
app_store UI: reload our_apps after publishing a new one
This commit is contained in:
parent
cdd04f12f9
commit
825e04ea2b
@ -41,6 +41,18 @@ export default function PublishPage() {
|
|||||||
}
|
}
|
||||||
}, [packageName, publisherId, fetchDownloadsForApp]);
|
}, [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) => {
|
const validatePackageName = useCallback((name: string) => {
|
||||||
// Allow lowercase letters, numbers, hyphens, and dots
|
// Allow lowercase letters, numbers, hyphens, and dots
|
||||||
const validNameRegex = /^[a-z0-9.-]+$/;
|
const validNameRegex = /^[a-z0-9.-]+$/;
|
||||||
@ -173,12 +185,6 @@ export default function PublishPage() {
|
|||||||
gas: BigInt(1000000),
|
gas: BigInt(1000000),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Reset form fields
|
|
||||||
setPackageName("");
|
|
||||||
setPublisherId(window.our?.node || "");
|
|
||||||
setMetadataUrl("");
|
|
||||||
setMetadataHash("");
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user