bustle/mobiledoc-kit

[Question] How to determine the reason for a card teardown?

Opened this issue · 0 comments

Is there a way to determine the reason, why a card is torn down?

The reason I am asking is, that I am working on an image card, that copies the image to another location when used. If the card is torn down by deleting it in the editor, I want to remove the copied image, but if the whole editor is torn down due to a switch to another post, I don’t want to delete the copied image.

Essentially I need to know in the env.onTeardown callback, if the teardown is caused by deleting the section, or by the editor.destroy function.