// Upgrade app settings from Show Links v1.0.10 to >=1.1.0
let prevCustomURL = app.getValue('showLinks_CustomSearchEngine', '');
let prevEnabled = app.getValue('showLinks_EnableCustomSearchEngine', false);

if (prevCustomURL && prevEnabled) {
    app.setValue('showLinks_CustomSearchEngine_1', prevCustomURL);
    app.setValue('showLinks_CustomSearchEngineTitle_1', 'Custom 1');
    app.setValue('showLinks_CustomSearchEngineEnabled_1', true);
    app.removeValue('showLinks_CustomSearchEngine');
    app.removeValue('showLinks_EnableCustomSearchEngine');
    uitools.toastMessage.show('Show Links has been upgraded and the previous custom search engine has been set to Custom 1. Check the addon settings page for details.')
}
else {
    console.log('Show Links: upgrade.js has run but the previous tag for showLinks_CustomSearchEngine was not set. Not doing anything.');
}