Skip to main content
Graham_Paterson
March 25, 2024
Solved

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
This topic has been closed for replies.
tank666
tank666Solution
March 25, 2024

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

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank

4 replies

tank666
tank666Solution
March 25, 2024

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

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
Graham_Paterson
March 25, 2024

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!

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
Graham_Paterson
March 25, 2024

Okay great, thanks for the help!