mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Fix 8.16: Switching Board View fails with 403 error.
Thanks to xet7 !
This commit is contained in:
parent
f8e576e890
commit
550d87ac6c
2 changed files with 22 additions and 2 deletions
|
|
@ -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();
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue