fix multi user sync local storage#3265
fix multi user sync local storage#3265six7 wants to merge 1 commit intomulti-user-sync-local-storagefrom
Conversation
|
| newActiveTheme: typeof pluginMessage.activeTheme === 'string' | ||
| ? { [INTERNAL_THEMES_NO_GROUP]: pluginMessage.activeTheme } | ||
| : pluginMessage.activeTheme ?? {}, | ||
| shouldUpdateDocument: !pluginMessage.isExternalChange, // if the change is external, we don't want to update the document as it would trigger a loop |
There was a problem hiding this comment.
and other setActiveTheme related code: made sure to pass along a prop to not cause updateDocument to appear when its an external change
| }, | ||
| setBaseFontSize: (payload, rootState) => { | ||
| setUI(rootState.settings); | ||
| dispatch.tokenState.updateDocument({ shouldUpdateNodes: false, updateRemote: false }); |
There was a problem hiding this comment.
baseFontSize kept being called. This property is stored on client storage - there's no need to update document when that changes, fixed that.
|
|
||
| export const LastModifiedByProperty = new FigmaStorageProperty<string>( | ||
| FigmaStorageType.CLIENT_STORAGE, | ||
| FigmaStorageType.SHARED_PLUGIN_DATA, |
There was a problem hiding this comment.
correctly reads and sets property on shared plugin space, not on client storage (this was the cause why it was always showing the current user)
There was a problem hiding this comment.
I am still facing the same issue, even on shared_plugin_data
is this working for you?
| }, [remoteData, tokens, themes, storageType]); | ||
|
|
||
| const hasChanges = useMemo(() => { | ||
| if (storageType.provider === StorageProviderType.LOCAL) { |
There was a problem hiding this comment.
fixed change state detection to not trigger if we're on local storage
|
|
|
Commit SHA:c3c187990fea89fb814b2fe8135870ca8f44cf3b Test coverage results 🧪
|
|
Commit SHA:c3c187990fea89fb814b2fe8135870ca8f44cf3b |
Key changes:
setActiveThemerelated code: made sure to pass along a prop to not cause updateDocument to appear when its an external change