How to respond to a change in document mode in Office Javascript Word AddIn
We have a Word JavaScript AddIn that assists users with authoring content. The AddIn is only functional when a ReadWrite document is loaded so we check Office.context.document.mode to ensure it is "readWrite" when the AddIn starts up. That works as expected but if the file mode changes (e.g. the user checks out the file from SharePoint) the mode does not update - i.e. it still returns "readOnly". If we reload the AddIn the mode returns the expected value.
So my question is whether there is a way to force Office.context.document.mode to update to reflect the current document mode? Alternatively, is there some way to listen for document changes so we can automatically reload the AddIn?