From b40066755f0b034b9530c80773ed842569ab896c Mon Sep 17 00:00:00 2001 From: familyfriendlymikey Date: Sun, 24 Jul 2022 00:52:17 -0400 Subject: [PATCH] make links open in new tab properly --- app/client.imba | 16 ++++++++-------- package.json | 2 +- sw.imba | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/client.imba b/app/client.imba index 79a9ebe..0467bc5 100644 --- a/app/client.imba +++ b/app/client.imba @@ -53,12 +53,6 @@ tag app state.links = await db.reload! sort_links! - def navigate link - link.last_opened = Date.now! - link.frequency = link.frequency + 1 - await db.put link - window.location.href = "//{link.link}" - def sort_links if state.query.trim!.length > 0 state.scored_links = fzy state.links, state.query @@ -66,6 +60,11 @@ tag app state.scored_links = sortBy(state.links) do |link| -link.frequency + def navigate link + link.last_opened = Date.now! + link.frequency = link.frequency + 1 + await db.put link + def handle_click_link link navigate link @@ -332,9 +331,10 @@ tag app if state.scored_links.length > 0 <.links> for obj, index in state.scored_links - <.link + <.link-left> diff --git a/package.json b/package.json index a8b296b..946eee9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fuzzyhome", - "version": "0.0.29", + "version": "0.0.30", "scripts": { "start": "imba run -SMH --baseurl . -w server.imba", "build-app": "rm -rf dist && imba build -SMH --baseurl . server.imba", diff --git a/sw.imba b/sw.imba index cb06805..818037b 100644 --- a/sw.imba +++ b/sw.imba @@ -1,7 +1,7 @@ let p = console.log const app_prefix = "fuzzyhome_cache" -const version = "0.0.29" +const version = "0.0.30" const cache_name = "{app_prefix}-{version}"