Skip to content

Commit

Permalink
Accounted for multiple selections
Browse files Browse the repository at this point in the history
If the user has one text layer selected, but other frames or groups, the notifications will show messaging for both: Warning + Success
  • Loading branch information
megaroeny committed Apr 14, 2021
1 parent 4ce1420 commit 9db634c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ figma.currentPage.selection.forEach(node => {
if (layerCount > 1 && successCount > 1) {
figma.notify("✅ " + successCount + " text layer names reset", { timeout: 2000 });
}
else if (layerCount == 1 && successCount == 1) {
else if (successCount == 1) {
figma.notify("✅ Text layer name reset", { timeout: 2000 });
}
figma.closePlugin();
2 changes: 1 addition & 1 deletion code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ figma.currentPage.selection.forEach(node => {
if (layerCount > 1 && successCount > 1) {
figma.notify("✅ " + successCount + " text layer names reset", { timeout: 2000 })
}
else if (layerCount == 1 && successCount == 1) {
else if (successCount == 1) {
figma.notify("✅ Text layer name reset", { timeout: 2000 })
}

Expand Down

1 comment on commit 9db634c

@megaroeny
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @tank666 !

Please sign in to comment.