Fix #511 but break nativegate

This commit is contained in:
Oliver Blanthorn 2018-05-10 14:14:37 +01:00
parent 45b4d9369e
commit ab444cf1dc
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -4,7 +4,6 @@
import * as semverCompare from "semver-compare"
import * as config from "./config"
import * as excmds from "./.excmds_background.generated"
import Logger from "./logging"
const logger = new Logger("native")
@ -152,9 +151,7 @@ export async function nativegate(
)
) {
if (interactive == true)
excmds.fillcmdline(
"# Tridactyl's native messenger doesn't support your operating system, yet.",
)
throw "# Tridactyl's native messenger doesn't support your operating system, yet."
return false
}
try {
@ -162,25 +159,19 @@ export async function nativegate(
if (actualVersion !== undefined) {
if (semverCompare(version, actualVersion) > 0) {
if (interactive == true)
excmds.fillcmdline(
"# Please update to native messenger " +
version +
", for example by running `:updatenative`.",
)
throw "# Please update to native messenger " +
version +
", for example by running `:updatenative`."
// TODO: add update procedure and document here.
return false
}
return true
} else if (interactive == true)
excmds.fillcmdline(
"# Native messenger not found. Please run `:installnative` and follow the instructions.",
)
throw "# Native messenger not found. Please run `:installnative` and follow the instructions."
return false
} catch (e) {
if (interactive == true)
excmds.fillcmdline(
"# Native messenger not found. Please run `:installnative` and follow the instructions.",
)
throw "# Native messenger not found. Please run `:installnative` and follow the instructions."
return false
}
}