mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 17:13:49 -07:00
Better message handling on save
This commit is contained in:
parent
03c085030e
commit
ef58acb4b5
7 changed files with 63 additions and 64 deletions
|
@ -10,19 +10,11 @@ define(['app', 'Settings/SettingsModel', 'Shared/Messenger'], function () {
|
|||
|
||||
saveSettings: function () {
|
||||
if (!this.model.isSaved) {
|
||||
this.model.save(undefined, this.syncNotification("General Settings Saved", "Couldn't Save General Settings"));
|
||||
this.model.save(undefined, NzbDrone.Settings.SyncNotificaiton.callback({
|
||||
successMessage: 'General Settings saved',
|
||||
errorMessage: "Failed to save General Settings"
|
||||
}));
|
||||
}
|
||||
},
|
||||
|
||||
syncNotification: function (success, error) {
|
||||
return {
|
||||
success: function () {
|
||||
NzbDrone.Shared.Messenger.show({message: success});
|
||||
},
|
||||
error : function () {
|
||||
NzbDrone.Shared.Messenger.show({message: error, type: 'error'});
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue