PublishStatus

Looking for some details about PublishStatus and getPublishStatusAsync().

As far as I can tell getPublishStatusAsync() always returns UNPUBLISHED outside of the library file itself. Am I missing something here?

Steps I took

  1. create new file that has access to team library
  2. Insert instance from library (by dragging from asset panel)
  3. get main component from instance using getMainComponentAsync()
  4. run getPublishStatusAsync() on main component
  5. results UNPUBLISHED

That’s right. This API is designed for library files.

Ah okay, just to confirm using pseudocode below:

Library File
↳ ❖ Published Component
↳ ◇ Instance (of ❖ Published Component)

instance.mainComponent.getPublishStatus == 'CURRENT' | 'CHANGED'

Working File
↳ ◇ Instance (of ❖ Published Component)

instance.mainComponent.getPublishStatus == 'UNPUBLISHED'

The UNPUBLISHED value can also be present in a library file.

Right!

Okay great, thanks for the help!