mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-04 17:04:59 +03:00
Check for Ghost Desktop manual update
If the user is running a version of Ghost Desktop that requires a manual update, we display a little warning message referring to a blog post on dev.ghost.org.
This commit is contained in:
parent
2032729522
commit
289742a7b5
@ -96,6 +96,7 @@ export default Route.extend(ApplicationRouteMixin, ShortcutsRoute, {
|
|||||||
signedIn() {
|
signedIn() {
|
||||||
this.get('notifications').clearAll();
|
this.get('notifications').clearAll();
|
||||||
this.send('loadServerNotifications', true);
|
this.send('loadServerNotifications', true);
|
||||||
|
this.send('checkForOutdatedDesktopApp');
|
||||||
},
|
},
|
||||||
|
|
||||||
invalidateSession() {
|
invalidateSession() {
|
||||||
@ -122,6 +123,26 @@ export default Route.extend(ApplicationRouteMixin, ShortcutsRoute, {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
checkForOutdatedDesktopApp() {
|
||||||
|
// Check if the user is running an older version of Ghost Desktop
|
||||||
|
// that needs to be manually updated
|
||||||
|
// (yes, the desktop team is deeply ashamed of these lines 😢)
|
||||||
|
let ua = navigator && navigator.userAgent ? navigator.userAgent : null;
|
||||||
|
|
||||||
|
if (ua && ua.includes && ua.includes('ghost-desktop')) {
|
||||||
|
let updateCheck = /ghost-desktop\/0\.((5\.0)|((4|2)\.0)|((3\.)(0|1)))/;
|
||||||
|
let link = '<a href="https://dev.ghost.org/ghost-desktop-manual-update" target="_blank">click here</a>';
|
||||||
|
let msg = `Your version of Ghost Desktop needs to be manually updated. Please ${link} to get started.`;
|
||||||
|
|
||||||
|
if (updateCheck.test(ua)) {
|
||||||
|
this.get('notifications').showAlert(msg.htmlSafe(), {
|
||||||
|
type: 'upgrade',
|
||||||
|
key: 'desktop.manual.upgrade'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
toggleMarkdownHelpModal() {
|
toggleMarkdownHelpModal() {
|
||||||
this.get('controller').toggleProperty('showMarkdownHelpModal');
|
this.get('controller').toggleProperty('showMarkdownHelpModal');
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user