Fix 8.16: Switching Board View fails with 403 error.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2025-11-05 16:35:29 +02:00
parent f8e576e890
commit 550d87ac6c
2 changed files with 22 additions and 2 deletions

View file

@ -231,9 +231,21 @@ Utils = {
window.location.reload(); window.location.reload();
}, },
setBoardView(view) { setBoardView(view) {
currentUser = ReactiveCache.getCurrentUser(); const currentUser = ReactiveCache.getCurrentUser();
if (currentUser) { if (currentUser) {
ReactiveCache.getCurrentUser().setBoardView(view); // Update localStorage first
window.localStorage.setItem('boardView', view);
// Update user profile via Meteor method
Meteor.call('setBoardView', view, (error) => {
if (error) {
console.error('[setBoardView] Update failed:', error);
} else {
// Reload to apply the view change
Utils.reload();
}
});
} else if (view === 'board-view-swimlanes') { } else if (view === 'board-view-swimlanes') {
window.localStorage.setItem('boardView', 'board-view-swimlanes'); //true window.localStorage.setItem('boardView', 'board-view-swimlanes'); //true
Utils.reload(); Utils.reload();

View file

@ -1729,6 +1729,14 @@ Meteor.methods({
const user = ReactiveCache.getCurrentUser(); const user = ReactiveCache.getCurrentUser();
user.setMobileMode(enabled); user.setMobileMode(enabled);
}, },
setBoardView(view) {
check(view, String);
const user = ReactiveCache.getCurrentUser();
if (!user) {
throw new Meteor.Error('not-authorized', 'Must be logged in');
}
user.setBoardView(view);
},
}); });
if (Meteor.isServer) { if (Meteor.isServer) {