Disable Form after Submit Success!

I saw the Wix forms update last few days. I’m not clear something that how can I disable the form for one day after user submitted successfully.

Here is a code that I’ve tried:

import wixData from 'wix-data';
import wixWindow from 'wix-window';

$w.onReady(function () {
  // Check if the form is disabled
  checkFormStatus();

  // Add event handler for form submission
  $w("#myForm").onAfterSave(handleFormSubmission);
});

function checkFormStatus() {
  // Check if form is disabled in local storage
  const isFormDisabled = JSON.parse(localStorage.getItem('isFormDisabled')) || false;

  if (isFormDisabled) {
    // Disable the form
    $w("#myForm").disable();
  }
}

function handleFormSubmission() {
  // Disable the form
  $w("#myForm").disable();

  // Save the form disable status in local storage
  localStorage.setItem('isFormDisabled', JSON.stringify(true));

  // Enable the form after one day (24 hours)
  setTimeout(function () {
    $w("#myForm").enable();
    localStorage.setItem('isFormDisabled', JSON.stringify(false));
  }, 24 * 60 * 60 * 1000); // 24 hours in milliseconds
}

I’m not familiar with the new WixForms v2 codes.