Skip to content

Commit

Permalink
Add Amazon S3 access and use async page setting
Browse files Browse the repository at this point in the history
Include "https://*.amazonaws.com" to allowed domains for network access to enable communication with Amazon S3. Replace synchronous calls with asynchronous alternatives for setting the current page in multiple code instances to improve performance and prevent blocking the execution thread.
  • Loading branch information
boybook committed Dec 8, 2024
1 parent 2231fe9 commit d84a43f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"networkAccess": {
"allowedDomains": [
"https://notion.boybook.workers.dev",
"https://api.figma.com"
"https://api.figma.com",
"https://*.amazonaws.com"
]
},
"permissions": [
Expand Down
4 changes: 2 additions & 2 deletions src/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ handleEvent('request-selection', () => {
handleEvent('select-node', async (nodeId: string) => {
const node = await figma.getNodeByIdAsync(nodeId);
if (node) {
figma.currentPage = getPageNode(node);
await figma.setCurrentPageAsync(getPageNode(node));
if (node.type !== 'PAGE') {
figma.currentPage.selection = [getPageRootNode(node)];
figma.viewport.scrollAndZoomIntoView([node]);
Expand Down Expand Up @@ -250,7 +250,7 @@ async function checkSelectCanvasTag() {
const nodeId = select.name.slice(4);
const node = await figma.getNodeByIdAsync(nodeId);
if (node) {
figma.currentPage = getPageNode(node);
await figma.setCurrentPageAsync(getPageNode(node));
figma.currentPage.selection = [<SceneNode> node];
}
}
Expand Down

0 comments on commit d84a43f

Please sign in to comment.