Merge pull request #190 from glacambre/fix_gh_homepage

src/excmds.ts: Fix gh failing to open the homepage.
This commit is contained in:
Oliver Blanthorn 2017-12-02 12:01:49 +00:00 committed by GitHub
commit f29cacbd46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -258,6 +258,7 @@ export async function reloadhard(n = 1) {
//#content
export function open(...urlarr: string[]) {
let url = urlarr.join(" ")
console.log("open url:" + url)
window.location.href = forceURI(url)
}
@ -274,7 +275,7 @@ export function home(all: "false" | "true" = "false"){
let homepages = config.get("homepages")
console.log(homepages)
if (homepages.length > 0){
if (all === "false") open(homepages[-1])
if (all === "false") open(homepages[homepages.length - 1])
else {
homepages.map(t=>tabopen(t))
}