Add new agreed URLs to account data instead of overwriting

This changes terms account data storage to always add, rather than setting only
the current set of displayed URLs.

Fixes https://github.com/vector-im/riot-web/issues/10755
This commit is contained in:
J. Ryan Stinnett 2019-09-05 13:38:32 +01:00
parent 4575aaa9f6
commit 0929a9cc72

View file

@ -119,7 +119,8 @@ export async function startTermsFlow(
if (unagreedPoliciesAndServicePairs.length > 0) {
const newlyAgreedUrls = await interactionCallback(unagreedPoliciesAndServicePairs, [...agreedUrlSet]);
console.log("User has agreed to URLs", newlyAgreedUrls);
agreedUrlSet = new Set(newlyAgreedUrls);
// Merge with previously agreed URLs
newlyAgreedUrls.forEach(url => agreedUrlSet.add(url));
} else {
console.log("User has already agreed to all required policies");
}