Know if there is modification before close diagram

Hi,

I would like to know if we can know if there is modification on a diagram open on the modeler since the last save (in order to ask for saving before close)

Moreover, if this is possible to know if there is an action that have been undo (in order to disabled undo and/or redo button)

Thanks,
Romain.

Sorry for that question, I just find the solution with :

this.modeler.get(‘commandStack’).canRedo()

To be sure, did the commandStack impletent this ? No

note all function are implemented but I find :

  • undo/redo
  • canUndo/canRedo
  • clear (I clear the commandStack when I save the diagram)

If you know others ones, I appreciate that you give me them (boring to try one by one if they exist)

Romain

You can see how the command stack is implemented here. Hope that helps.

Thank you !

that’s exactly what I was looking for :slight_smile: .
probably I should look more on the github and less on my package. I never think about blob.

Romain