0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Fixed saving of custom views expansion state

no issue

- if `user.accessibility` is `null` as it is for newly created users then toggling the expansion state of custom views menus failed to save because we were assuming there was an object available
This commit is contained in:
Kevin Ansfield 2020-05-18 13:45:59 +01:00
parent e7b198df4a
commit 481bdfbe1a

View file

@ -52,7 +52,7 @@ export default class NavigationService extends Service {
async _saveNavigationSettings() {
let user = await this.session.user;
let userSettings = JSON.parse(user.get('accessibility'));
let userSettings = JSON.parse(user.get('accessibility')) || {};
userSettings.navigation = this.settings;
user.set('accessibility', JSON.stringify(userSettings));
return user.save();