Skip to content

Commit a165bec

Browse files
committed
refactor: move allData in SDKState block
1 parent 4f98dfa commit a165bec

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

src/persistence.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ export default function _Persistence(mpInstance) {
8585
} else {
8686
self.storeDataInMemory(cookies);
8787
}
88+
89+
// https://go.mparticle.com/work/SQDSDKS-6046
90+
// Stores all non-current user MPID information into the store
91+
for (var key in allData) {
92+
if (allData.hasOwnProperty(key)) {
93+
if (!SDKv2NonMPIDCookieKeys[key]) {
94+
mpInstance._Store.nonCurrentUserMPIDs[key] =
95+
allData[key];
96+
}
97+
}
98+
}
8899
}
89100

90101
// https://go.mparticle.com/work/SQDSDKS-6048
@@ -115,18 +126,6 @@ export default function _Persistence(mpInstance) {
115126
'Error loading products in initialization: ' + e
116127
);
117128
}
118-
if (!mpInstance._Store.getPrivacyFlag('SDKState')) {
119-
// https://go.mparticle.com/work/SQDSDKS-6046
120-
// Stores all non-current user MPID information into the store
121-
for (var key in allData) {
122-
if (allData.hasOwnProperty(key)) {
123-
if (!SDKv2NonMPIDCookieKeys[key]) {
124-
mpInstance._Store.nonCurrentUserMPIDs[key] =
125-
allData[key];
126-
}
127-
}
128-
}
129-
}
130129
self.update();
131130
} catch (e) {
132131
// If cookies or local storage is corrupt, we want to remove it

0 commit comments

Comments
 (0)