Skip to content

Commit

Permalink
feat: set up new cloudcommerce apps with cc_pid=x url param
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Aug 17, 2022
1 parent 9cfedc6 commit 400afe9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
if (sessionStorage.getItem('api_v') === '2') {
ECOMCLIENT_API_STORE = 'https://ecomplus.io/v2/'
}
if (sessionStorage.getItem('cloudcomm_pid')) {
CLOUDCOMMERCE_PROJECT_ID = sessionStorage.getItem('cloudcomm_pid')
}
</script>
</head>

Expand Down
4 changes: 4 additions & 0 deletions src/login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ const initDashboard = (storeId, username, session) => {
if (isApiv2) {
window.ECOMCLIENT_API_STORE = 'https://ecomplus.io/v2/'
sessionStorage.setItem('api_v', '2')
const cloudcommercePid = getAuthState('cc_pid')
if (cloudcommercePid) {
sessionStorage.setItem('cloudcomm_pid', cloudcommercePid)
}
}

return import(/* webpackChunkName: "dashboard" */ '@/dashboard')
Expand Down

0 comments on commit 400afe9

Please sign in to comment.