From f73b8c1453b345e27be28fb4fe21d1512dafda83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Sun, 26 Nov 2023 22:17:52 +0100 Subject: [PATCH] fix: set auto-connect to false by default fixes #25 --- src/lib/preferences.ts | 6 +++--- src/lib/title.ts | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib/preferences.ts b/src/lib/preferences.ts index b6e4e914..d56eadbb 100644 --- a/src/lib/preferences.ts +++ b/src/lib/preferences.ts @@ -1,5 +1,5 @@ -import type {Action} from "svelte/action" -import {persistentWritable} from "$lib/storage" +import type { Action } from "svelte/action" +import { persistentWritable } from "$lib/storage" export interface UserPreferences { backup: boolean @@ -13,7 +13,7 @@ export const theme = persistentWritable("user-theme", { export const userPreferences = persistentWritable("user-preferences", { backup: false, - autoConnect: true, + autoConnect: false, }) export const preference: Action = (node, key) => { diff --git a/src/lib/title.ts b/src/lib/title.ts index b8d399e2..7a7cab02 100644 --- a/src/lib/title.ts +++ b/src/lib/title.ts @@ -1,12 +1,12 @@ -import type {Action} from "svelte/action" +import type { Action } from "svelte/action" import tippy from "tippy.js" -import type {SvelteComponent} from "svelte" +import type { SvelteComponent } from "svelte" import Tooltip from "$lib/components/Tooltip.svelte" import hotkeys from "hotkeys-js" -export const action: Action = ( +export const action: Action = ( node: HTMLElement, - {title, shortcut}, + { title, shortcut }, ) => { let component: SvelteComponent | undefined const tooltip = tippy(node, { @@ -16,7 +16,7 @@ export const action: Action = onShow(instance) { component ??= new Tooltip({ target: instance.popper.querySelector(".tippy-content") as HTMLElement, - props: {title, shortcut}, + props: { title, shortcut }, }) }, onHidden() { @@ -26,7 +26,7 @@ export const action: Action = }) if (shortcut) { - hotkeys(shortcut, function (keyboardEvent) { + hotkeys(shortcut, function(keyboardEvent) { keyboardEvent.preventDefault() node.click() })