From 8778ca5f6c2d0f39172f7568955725de0493c650 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Fri, 24 Jan 2025 00:02:45 +0100 Subject: [PATCH] fix(services): fix type errors --- src/services/scheduler.ts | 2 +- src/services/sync_options.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/services/scheduler.ts b/src/services/scheduler.ts index 17edfe6f1..2c0151887 100644 --- a/src/services/scheduler.ts +++ b/src/services/scheduler.ts @@ -19,7 +19,7 @@ function getRunAtHours(note: BNote): number[] { } function runNotesWithLabel(runAttrValue: string) { - const instanceName = config.General ? config.General.instanceName : null; + const instanceName = config.General.instanceName; const currentHours = new Date().getHours(); const notes = attributeService.getNotesWithLabel("run", runAttrValue); diff --git a/src/services/sync_options.ts b/src/services/sync_options.ts index b7dc7f091..5bbb395f3 100644 --- a/src/services/sync_options.ts +++ b/src/services/sync_options.ts @@ -1,7 +1,6 @@ "use strict"; import optionService from "./options.js"; -import type { OptionNames } from "./options_interface.js"; import config from "./config.js"; /* @@ -11,8 +10,8 @@ import config from "./config.js"; * to live sync server. */ -function get(name: OptionNames) { - return (config["Sync"] && config["Sync"][name]) || optionService.getOption(name); +function get(name: keyof typeof config.Sync) { + return (config["Sync"] && config["Sync"][name]) || optionService.getOption(name); } export default {