Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
πŸ› fix errors when navigating after successful import
Browse files Browse the repository at this point in the history
no issue
- the synchronous settings service keeps an internal reference to the settings model, when everything in the store is unloaded during an import that reference breaks and will throw errors when accessing areas of the app that read values from it. This change adds an explicit reload of the settings model during import so that later navigation doesn't break.
  • Loading branch information
kevinansfield committed May 24, 2017
1 parent b2c8db4 commit 86d5a6b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/settings/labs.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default Controller.extend({
ghostPaths: injectService(),
notifications: injectService(),
session: injectService(),
settings: injectService(),
ajax: injectService(),

// TODO: convert to ember-concurrency task
Expand Down Expand Up @@ -111,8 +112,12 @@ export default Controller.extend({
run.schedule('destroy', this, () => {
// Reload currentUser and set session
this.set('session.user', store.findRecord('user', currentUserId));

// TODO: keep as notification, add link to view content
notifications.showNotification('Import successful.', {key: 'import.upload.success'});

// reload settings
return this.get('settings').reload();
});
}).catch((response) => {
if (isUnsupportedMediaTypeError(response)) {
Expand Down

0 comments on commit 86d5a6b

Please sign in to comment.