Skip to content

Commit

Permalink
should use ; as a delimiter for the swatches saves in localstorage
Browse files Browse the repository at this point in the history
  • Loading branch information
Yair Even Or authored and Yair Even Or committed Mar 26, 2023
1 parent 50acba2 commit b4134f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/swatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export function getSetGlobalSwatches(data){
customKey = typeof _store == 'string' ? _store : '';

if ( _store && data ){
localStorage.setItem(storeKey + customKey, data)
localStorage.setItem(storeKey + customKey, data.join(';'))
dispatchEvent( new Event('storage') )
}

// "filter(String)" clean up any empty strings
return localStorage[storeKey + customKey]?.split(',').filter(String) || []
return localStorage[storeKey + customKey]?.split(';').filter(String) || []
}

// sync instance swatches with global ones. skip duplicates
Expand Down

0 comments on commit b4134f6

Please sign in to comment.