I am working on implementing a custom async request in one of my extensions. Note, I am not using the Divi-5 RestAPI/Fetch implementation. Instead, I am using my own custom Rest Route with an Axios get request.
I have noticed that when saving the page in the Visual Builder using the quick-key (Command-s) it is triggering the page to redraw and therefore also triggering the get request to run. This doesn’t happen when clicking on the Save button in the Visual Builder, only when using the quick-key. Also, it doesn’t seem to occur when using the Divi-5 RestAPI/Fetch implementation.
Is there anyway that I can prevent this redraw from happening, and/or detect the save event and prevent the get request from running?
I have attached a screen recording. It shows me saving the page twice. Once using the quick-key and the second time clicking on the Save button. Notice how when using the quick-key the table (which is fetched with the Axios get request) is re-loaded. But when clicking the Save button it isn’t.
Related thread: https://discord.com/channels/1041765492907589683/1079860683623116862/threads/1184025566576394240
Problem:
I am working on implementing a custom async request in one of my extensions. Note, I am not using the Divi-5 RestAPI/Fetch implementation. Instead, I am using my own custom Rest Route with an Axios
get
request.I have noticed that when saving the page in the Visual Builder using the quick-key (Command-s) it is triggering the page to redraw and therefore also triggering the
get
request to run. This doesn’t happen when clicking on theSave
button in the Visual Builder, only when using the quick-key. Also, it doesn’t seem to occur when using the Divi-5 RestAPI/Fetch implementation.Is there anyway that I can prevent this redraw from happening, and/or detect the save event and prevent the
get
request from running?I have attached a screen recording. It shows me saving the page twice. Once using the quick-key and the second time clicking on the
Save
button. Notice how when using the quick-key the table (which is fetched with the Axiosget
request) is re-loaded. But when clicking theSave
button it isn’t.Any help would be appreciated. Thanks!