Skip to content

Commit

Permalink
Merge pull request #89 from asad-rafter/CLD-287-remember-MLW-path
Browse files Browse the repository at this point in the history
open last accessed folder
  • Loading branch information
yuval-cloudinary authored Aug 26, 2024
2 parents 9740240 + 8d86b6b commit 4be048d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@
showError('Wrong asset type.');
} else {
isAssetRestricted(config.assetInfoUrl, asset).then(((restricted) => {
if (asset.resource_type === 'image') {
localStorage.setItem('imagePath', asset.public_id.substring(0, asset.public_id.lastIndexOf('/')));
} else {
localStorage.setItem('videoPath', asset.public_id.substring(0, asset.public_id.lastIndexOf('/')));
}

if (!restricted) {
emit({
type: 'sfcc:valid',
Expand Down Expand Up @@ -159,7 +165,7 @@
} else {
show.folder = {
resource_type: config.type,
path: null
path: config.type === 'image' ? localStorage.getItem('imagePath') : localStorage.getItem('videoPath')
};
}

Expand Down

0 comments on commit 4be048d

Please sign in to comment.