Skip to content

Fixed code.js #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fixed code.js #188

wants to merge 2 commits into from

Conversation

Saanket-Das
Copy link

Ensure figma.loadAllPagesAsync() is supported

This API is not officially documented, and if it doesn’t exist, it will throw an error. You might want to check if it exists before calling it.
figma.ui.postMessage should not use { origin: "*" }

The second argument for figma.ui.postMessage is unnecessary, as it only accepts a single argument in Figma Plugins.
Ensure change.style is defined before accessing .name

You are using change.style?.name, but in some cases, change.style may be undefined. You should check it explicitly.

 Removes { origin: "*" } from figma.ui.postMessage (unnecessary in Figma Plugins).
 Prevents possible undefined access on change.style before accessing .name.
 Uses type !== "STYLE_CREATE" && type !== "STYLE_DELETE" instead of noop for better readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant