Skip to content

Commit

Permalink
Add page reload after consent is changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
DonRichards authored Apr 2, 2024
1 parent b3b3ef8 commit 566cc16
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/app/shared/cookies/browser-klaro.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,20 @@ export class BrowserKlaroService extends KlaroService {
* @param user
*/
updateSettingsForUsers(user: EPerson) {
this.setSettingsForUser(user, this.cookieService.get(this.getStorageName(user.uuid)));
this.setSettingsForUser(user, this.cookieService.get(this.getStorageName(user.uuid)))
.pipe(take(1)) // Ensures the observable completes after the first emitted value
.subscribe({
next: (result) => {
// Logic to check if the settings were successfully updated
// This depends on how `setSettingsForUser` is implemented and what it returns
if (result.success) {
window.location.reload(); // Triggers the page reload
}
},
error: (err) => {
console.error('Error updating user settings', err);
}

Check failure on line 355 in src/app/shared/cookies/browser-klaro.service.ts

View workflow job for this annotation

GitHub Actions / tests (16.x)

Missing trailing comma

Check failure on line 355 in src/app/shared/cookies/browser-klaro.service.ts

View workflow job for this annotation

GitHub Actions / tests (18.x)

Missing trailing comma
});
}

/**
Expand Down

0 comments on commit 566cc16

Please sign in to comment.