mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
get rid of superflorous notification
This commit is contained in:
parent
e513c279a4
commit
b40536c031
1 changed files with 0 additions and 43 deletions
|
@ -82,49 +82,6 @@ function startApplication() {
|
|||
|
||||
chrome.app.runtime.onLaunched.addListener(startApplication);
|
||||
|
||||
chrome.runtime.onInstalled.addListener(function (details) {
|
||||
if (details.reason == 'update') {
|
||||
var previousVersionArr = details.previousVersion.split('.'),
|
||||
currentVersionArr = getManifestVersion().split('.');
|
||||
|
||||
// only fire up notification sequence when one of the major version numbers changed
|
||||
if (currentVersionArr[0] > previousVersionArr[0] || currentVersionArr[1] > previousVersionArr[1]) {
|
||||
var manifest = chrome.runtime.getManifest();
|
||||
var options = {
|
||||
priority: 0,
|
||||
type: 'basic',
|
||||
title: manifest.name,
|
||||
message: chrome.i18n.getMessage('notifications_app_just_updated_to_version', [getManifestVersion(manifest)]),
|
||||
iconUrl: '/images/icon_128.png',
|
||||
buttons: [{'title': chrome.i18n.getMessage('notifications_click_here_to_start_app')}]
|
||||
};
|
||||
|
||||
chrome.notifications.create('baseflight_update', options, function (notificationId) {
|
||||
// empty
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
chrome.notifications.onButtonClicked.addListener(function (notificationId, buttonIndex) {
|
||||
if (notificationId == 'baseflight_update') {
|
||||
startApplication();
|
||||
}
|
||||
});
|
||||
|
||||
function getManifestVersion(manifest) {
|
||||
if (!manifest) {
|
||||
manifest = chrome.runtime.getManifest();
|
||||
}
|
||||
|
||||
var version = manifest.version_name;
|
||||
if (!version) {
|
||||
version = manifest.version;
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
function getChromeVersion () {
|
||||
var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue