mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
3c92c171f9
refs https://github.com/TryGhost/Ghost/issues/6976 - adds custom `MaintenanceError` and associated error checking functions - updates app route and notifications service to handle `503` errors via the `upgrade-status` service
24 lines
729 B
JavaScript
24 lines
729 B
JavaScript
import Service from 'ember-service';
|
|
import injectService from 'ember-service/inject';
|
|
|
|
export default Service.extend({
|
|
isRequired: false,
|
|
|
|
notifications: injectService(),
|
|
|
|
maintenanceAlert() {
|
|
this.get('notifications').showAlert(
|
|
'Sorry, Ghost is currently undergoing maintenance, please wait a moment then try again.',
|
|
{type: 'error', key: 'api-error.under-maintenance'}
|
|
);
|
|
},
|
|
|
|
requireUpgrade() {
|
|
this.set('isRequired', true);
|
|
this.get('notifications').showAlert(
|
|
'Ghost has been upgraded, please copy any unsaved data and refresh the page to continue.',
|
|
{type: 'error', key: 'api-error.upgrade-required'}
|
|
);
|
|
}
|
|
});
|