From a80061d97faf0a15633fc9872fd8d4d2ce19f0ec Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Mon, 16 Dec 2019 22:37:42 +0100 Subject: [PATCH] Update cordova launcher, remove unnecessary code --- app/scripts/comp/launcher/index.js | 2 +- app/scripts/comp/launcher/launcher-cordova.js | 17 ++++++----------- app/scripts/views/open-view.js | 4 ---- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/app/scripts/comp/launcher/index.js b/app/scripts/comp/launcher/index.js index 3280f150..93be744f 100644 --- a/app/scripts/comp/launcher/index.js +++ b/app/scripts/comp/launcher/index.js @@ -3,7 +3,7 @@ let Launcher; if (window.process && window.process.versions && window.process.versions.electron) { Launcher = require('./launcher-electron').Launcher; } else if (window.cordova) { - // Launcher = require('./launcher-cordova').Launcher; // commented out, while we don't support cordova + Launcher = require('./launcher-cordova').Launcher; } export { Launcher }; diff --git a/app/scripts/comp/launcher/launcher-cordova.js b/app/scripts/comp/launcher/launcher-cordova.js index 7d86270a..e9db520c 100644 --- a/app/scripts/comp/launcher/launcher-cordova.js +++ b/app/scripts/comp/launcher/launcher-cordova.js @@ -4,7 +4,7 @@ import { Events } from 'framework/events'; const Launcher = { name: 'cordova', - version: '6.0.0', + version: window.cordova.platformVersion, autoTypeSupported: false, thirdPartyStoragesSupported: false, clipboardSupported: false, @@ -25,7 +25,7 @@ const Launcher = { window.open(href, '_system'); }, devTools: false, - // openDevTools: function() { }, + openDevTools() {}, getSaveFileName(defaultPath, callback) { /* skip in cordova */ }, @@ -181,8 +181,7 @@ const Launcher = { createFsWatcher(path) { return null; // not in android with content provider }, - // ensureRunnable: function(path) { }, - + ensureRunnable(path) {}, preventExit(e) { e.returnValue = false; return false; @@ -190,7 +189,6 @@ const Launcher = { exit() { this.hideApp(); }, - requestExit() { /* skip in cordova */ }, @@ -200,11 +198,9 @@ const Launcher = { cancelRestart() { /* skip in cordova */ }, - setClipboardText(text) {}, getClipboardText() {}, clearClipboardText() {}, - minimizeApp() { this.hideApp(); }, @@ -217,8 +213,7 @@ const Launcher = { updaterEnabled() { return false; }, - - // getMainWindow: function() { }, + // getMainWindow() {}, resolveProxy(url, callback) { /* skip in cordova */ }, @@ -234,7 +229,7 @@ const Launcher = { showMainWindow() { /* skip in cordova */ }, - // spawn: function(config) { }, + // spawn(config) {}, openFileChooser(callback) { const onFileSelected = function(selected) { window.resolveLocalFileSystemURL(selected.uri, fileEntry => { @@ -248,7 +243,7 @@ const Launcher = { window.cordova.exec(onFileSelected, callback, 'FileChooser', 'choose'); }, - + setGlobalShortcuts(appSettings) {}, fingerprints: { config: { disableBackup: true, diff --git a/app/scripts/views/open-view.js b/app/scripts/views/open-view.js index 8567eb51..a87abe21 100644 --- a/app/scripts/views/open-view.js +++ b/app/scripts/views/open-view.js @@ -921,10 +921,6 @@ class OpenView extends View { } const fileInfo = this.model.fileInfos.get(lastOpenFiles[this.currentSelectedIndex].id); this.showOpenFileInfo(fileInfo); - - if (fileInfo && Launcher && Launcher.fingerprints) { - this.openFileWithFingerprint(fileInfo); - } } moveOpenFileSelectionDown() {