silexlabs/Silex

few successive ctrl+Z delete all

oliviermgx opened this issue · 3 comments

Using ctrl+Z in the interface works at the beginning, but if we make few ctrl+Z one after others, at about 10 times or less, all the site is deleted.

Ok i reproduce it, thank you !

I believe the problem comes from these lines... In case you want to check it out (and for me to remember if I do it)
https://github.com/silexlabs/Silex/blob/dev/src/ts/client/index.ts#L94

Probably they execute before grapesjs had time to parse the data or something

There is an event that i recently discobered which might be worth listening to, it may come after the parsing: canvas:frame:load. It is a GrapesJS event and here is how i used it. It might be a good idea to check if it would fix the bug by using this event in place of the setTimeout, or in addition to it. The event doc is here

Talk to you soon!

solved
see ctrlZ_branch_v2

ok great @oliviermgx !!! this is merged and will be live in the next release 🎆