mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-18 21:55:12 -04:00
Auto reload when server has been updated
New: Updating will reload UI on navigation
This commit is contained in:
@@ -28,6 +28,29 @@ define(
|
||||
xhr.headers['X-Api-Key'] = window.NzbDrone.ApiKey;
|
||||
}
|
||||
|
||||
return original.apply(this, arguments);
|
||||
return original.apply(this, arguments).done(function (response, status, xhr){
|
||||
var version = xhr.getResponseHeader('X-ApplicationVersion');
|
||||
|
||||
if (!window.NzbDrone || !window.NzbDrone.Version) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (version !== window.NzbDrone.Version) {
|
||||
var vent = require('vent');
|
||||
var messenger = require('Shared/Messenger');
|
||||
|
||||
if (!vent || !messenger) {
|
||||
return;
|
||||
}
|
||||
|
||||
messenger.show({
|
||||
message : 'NzbDrone has been updated',
|
||||
hideAfter : 0,
|
||||
id : 'droneUpdated'
|
||||
});
|
||||
|
||||
vent.trigger(vent.Events.ServerUpdated);
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user