From 048f96013e35e77844771deb33f2a2ec04cd4fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Leszczy=C5=84ski?= Date: Wed, 2 Oct 2024 00:56:12 +0200 Subject: [PATCH] Halo: always pick "credential" execution method by default (#414) --- core/src.ts/drivers/web.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/core/src.ts/drivers/web.ts b/core/src.ts/drivers/web.ts index b20efde..dae29e8 100644 --- a/core/src.ts/drivers/web.ts +++ b/core/src.ts/drivers/web.ts @@ -30,19 +30,11 @@ function makeDefault(curValue: Type | null | undefined, defaultValue: Type /** * Detect the best command execution method for the current device. - * @returns {string} Either "credential" or "webnfc". + * Historically, this method was trying to pick the best among "credential" or "webnfc". + * Right now it is going to statically return "credential" in all cases. */ -export function detectMethod() { - try { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-expect-error - new window.NDEFReader(); - } catch (e) { - // WebNFC not supported - return "credential"; - } - - return "webnfc"; +export function detectMethod(): "credential" { + return "credential"; } function defaultStatusCallback(cause: string, statusObj: StatusCallbackDetails) {