Skip to content

Commit

Permalink
Merge pull request #2361 from tokens-studio/feat/update-on-change
Browse files Browse the repository at this point in the history
Feat/ reintroduce update on change
  • Loading branch information
esthercheran authored Nov 15, 2023
2 parents 5df9f8e + 6015f46 commit e2f4a19
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/sweet-walls-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tokens-studio/figma-plugin": patch
---

Fixed an issue with Update on change. It's now working again, but disabled for new users as intended.
2 changes: 1 addition & 1 deletion src/app/store/models/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const settings = createModel<RootModel>()({
sessionRecording: false,
updateMode: UpdateMode.SELECTION,
updateRemote: true,
updateOnChange: true,
updateOnChange: false,
updateStyles: true,
tokenType: 'object',
ignoreFirstPartForStyles: false,
Expand Down
4 changes: 2 additions & 2 deletions src/app/store/models/tokenState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ export const tokenState = createModel<RootModel>()({
dispatch.tokenState.updateAliases({ oldName: payload.oldName, newName: payload.name });
}

if (payload.shouldUpdate && rootState.settings.updateOnChange) {
dispatch.tokenState.updateDocument({ shouldUpdateNodes: false });
if (payload.shouldUpdate && rootState.settings.updateMode !== 'document') {
dispatch.tokenState.updateDocument({ shouldUpdateNodes: rootState.settings.updateOnChange });
}
},
deleteToken() {
Expand Down

0 comments on commit e2f4a19

Please sign in to comment.