From 0929a9cc7287c800d3ea88b22a1d6bce13487756 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 5 Sep 2019 13:38:32 +0100 Subject: [PATCH] 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 --- src/Terms.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Terms.js b/src/Terms.js index 02e34cbb3f..594f15b522 100644 --- a/src/Terms.js +++ b/src/Terms.js @@ -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"); }