Bug fixes and enhancements

This commit is contained in:
An Phan 2016-01-01 14:47:03 +07:00
parent 739a447ce9
commit 8a247e1ed7
3 changed files with 14 additions and 13 deletions

View file

@ -73,7 +73,10 @@
this.hideOverlay();
// Ask for user's notificatio permission.
// Load the default view.
this.loadMainView('queue');
// Ask for user's notification permission.
this.requestNotifPermission();
// Let all other compoenents know we're ready.

View file

@ -43,18 +43,16 @@
this.$root.showOverlay();
settingStore.update(() => {
// Data changed.
// Everything changed.
// It's the time of the oath.
// We need refresh the page.
// Goodbye.
document.location.reload();
}, (error, status) => {
if (status === 422) {
error = utils.parseValidationError(error)[0];
// Re-init the app.
this.$root.init();
}, (error) => {
var msg = 'Unknown error.';
if (error.status === 422) {
msg = utils.parseValidationError(error.data)[0];
}
this.$root.showOverlay(`Error: ${error}`, 'error', true);
this.$root.showOverlay(`Error: ${msg}`, 'error', true);
});
},
},

View file

@ -16,7 +16,7 @@ export default {
return this.state.settings;
},
update(cb = null, error = null) {
http.post('settings', this.all(), cb, error);
update(successCb = null, errorCb = null) {
http.post('settings', this.all(), successCb, errorCb);
},
};