Skip to main content
Solved

PublishStatus

  • March 25, 2024
  • 4 replies
  • 168 views

Graham_Paterson

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

Best answer by tank666

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

This topic has been closed for replies.

4 replies

tank666
  • Answer
  • March 25, 2024

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


Graham_Paterson

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'

tank666
  • March 25, 2024

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

Right!


Graham_Paterson

Okay great, thanks for the help!