Reload the page with delay when adding record to a list block

Hello,
use this code in your page settings → Custom code ->. Footer section to reload the page when a record is added to a list block. Just replace the BLOCKID with your block name. Save and publish.

<script>
	window.addEventListener('submit-form-success-BLOCKID', () => {
	  setTimeout(() => {
                 //RELOAD BLOCK
                 window.dispatchEvent(new CustomEvent('reload-block-list1'));
		
               //RELOAD PAGE
               window.location.reload()
        }, 3000);
	});
</script>

Hi there,

I am wanting to do something similar to this.

I am using a conditional form on my home page to create a project record. On submit, I send the user to a new page with a list block of projects.

However when they are sent to the projects page after form submission, the record doesn’t show. It does show once I refresh the page. How would I adapt this script please?