commit 88db8775cb77bf4f20201ca625d3effcf8aae992 parent 0a64dc9618014db3a8bab29dd3ae9cf01cf2ff85 Author: Sebastian <sebasjm@taler-systems.com> Date: Sun, 3 May 2026 19:16:13 -0300 some minors changes suggested by an text completion algorithm Diffstat:
14 files changed, 17 insertions(+), 39 deletions(-)
diff --git a/packages/aml-backoffice-ui/src/components/NewMeasure.tsx b/packages/aml-backoffice-ui/src/components/NewMeasure.tsx @@ -314,7 +314,7 @@ function VerificationMeasureForm({ throw Error("verification doesn't have program"); } if (!initial.context) { - throw Error("verification doesn't have program"); + throw Error("verification doesn't have context"); } if (!initial.name) { throw Error("verification doesn't have name"); diff --git a/packages/aml-backoffice-ui/src/components/RulesInfo.tsx b/packages/aml-backoffice-ui/src/components/RulesInfo.tsx @@ -310,6 +310,6 @@ function sortKycRules(a: KycRule, b: KycRule): number { return Amounts.cmp(a.threshold, b.threshold); } const as = rate(Amounts.parseOrThrow(a.threshold), at.d_us); - const bs = rate(Amounts.parseOrThrow(a.threshold), bt.d_us); + const bs = rate(Amounts.parseOrThrow(b.threshold), bt.d_us); return bs - as; } diff --git a/packages/anastasis-webui/src/hooks/index.ts b/packages/anastasis-webui/src/hooks/index.ts @@ -26,7 +26,7 @@ export type ValueOrFunction<T> = T | ((p: T) => T); const calculateRootPath = () => { const rootPath = - typeof window !== undefined + typeof window !== "undefined" ? window.location.origin + window.location.pathname : "/"; return rootPath; diff --git a/packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx b/packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx @@ -33,8 +33,8 @@ export function ContinentSelectionScreen(): VNode { ) { return <div />; } - const selectContinent = (continent: string): void => { - reducer.transition("select_continent", { continent }); + const selectContinent = (continent: string): Promise<void> => { + return reducer.transition("select_continent", { continent }); }; const selectCountry = (country: string): void => { setCountryCode(country); @@ -48,8 +48,7 @@ export function ContinentSelectionScreen(): VNode { const selectCountryAction = async () => { // selection should be when the select box changes it value if (!theCountry) return; - // FIXME: Why is there no await? - reducer.transition("select_country", { + return reducer.transition("select_country", { country_code: countryCode, }); }; diff --git a/packages/anastasis-webui/src/pages/home/EditPoliciesScreen.tsx b/packages/anastasis-webui/src/pages/home/EditPoliciesScreen.tsx @@ -77,14 +77,6 @@ export function EditPoliciesScreen({ const policies = reducer.currentReducerState.policies ?? []; const policy = policies[policy_index]; - for ( - let method_index = 0; - method_index < allAuthMethods.length; - method_index++ - ) { - policy?.methods.find((m) => m.authentication_method === method_index) - ?.provider; - } function sendChanges(): void { const newMethods: MethodProvider[] = []; diff --git a/packages/auditor-backoffice-ui/src/hooks/index.ts b/packages/auditor-backoffice-ui/src/hooks/index.ts @@ -35,7 +35,7 @@ export function useBackendURL(url?: string): [string, StateUpdater<string>] { function calculateRootPath() { const rootPath = - typeof window !== undefined + typeof window !== "undefined" ? window.location.origin + window.location.pathname : "/"; diff --git a/packages/kyc-ui/src/pages/Start.tsx b/packages/kyc-ui/src/pages/Start.tsx @@ -141,11 +141,7 @@ export function Start({ token }: Props): VNode { <ShowReqList token={token} onFormSelected={async (r) => { - const reqId = r.id; - if (r.form === "LINK" && reqId) { - } else { - setReq(r); - } + setReq(r); }} /> </Fragment> diff --git a/packages/merchant-backoffice-ui/src/components/SolveMFA.tsx b/packages/merchant-backoffice-ui/src/components/SolveMFA.tsx @@ -13,9 +13,8 @@ import { LocalNotificationBannerBulma, SafeHandlerTemplate, undefinedIfEmpty, - useCommonPreferences, useLocalNotificationBetter, - useTranslationContext, + useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; import { Fragment, h, VNode } from "preact"; diff --git a/packages/merchant-backoffice-ui/src/components/form/Input.tsx b/packages/merchant-backoffice-ui/src/components/form/Input.tsx @@ -136,7 +136,7 @@ export function InternalTextInputSwitch({ inputType === "search" || inputType === "url" ) { - <input + return <input {...(rest as any)} ref={focus ? doAutoFocus : undefined} class={hasError ? "input is-danger" : "input"} diff --git a/packages/merchant-backoffice-ui/src/components/form/InputCode.tsx b/packages/merchant-backoffice-ui/src/components/form/InputCode.tsx @@ -18,14 +18,12 @@ * * @author Sebastian Javier Marchano (sebasjm) */ +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; +import { useRef, useState } from "preact/hooks"; import { Tooltip } from "../Tooltip.js"; -import { InputProps, useField } from "./useField.js"; -import { useRef } from "preact/hooks"; import { doAutoFocus } from "./Input.js"; -import { useEffect } from "preact/hooks"; -import { useState } from "preact/hooks"; -import { useTranslationContext } from "@gnu-taler/web-util/browser"; +import { InputProps, useField } from "./useField.js"; interface Props<T> extends InputProps<T> { inputExtra?: any; diff --git a/packages/merchant-backoffice-ui/src/context/session.ts b/packages/merchant-backoffice-ui/src/context/session.ts @@ -17,7 +17,6 @@ import { AccessToken, Codec, - CurrencySpecification, MerchantVersionResponse, TalerMerchantManagementHttpClient, buildCodecForObject, @@ -92,11 +91,6 @@ function inferInstanceName(url: URL) { return !match || !match[1] ? DEFAULT_ADMIN_USERNAME : match[1]; } -function recalculateUrlForAnotherUser(original: URL, user: string) { - const match = INSTANCE_ID_LOOKUP.exec(original.href); - return !match || !match[1] ? DEFAULT_ADMIN_USERNAME : match[1]; -} - export const defaultState = (url: URL): SavedSession => { return { backendUrl: url, diff --git a/packages/taler-wallet-webextension/src/components/AmountField.stories.tsx b/packages/taler-wallet-webextension/src/components/AmountField.stories.tsx @@ -37,7 +37,7 @@ function RenderAmount(): VNode { fraction: 0, }); - const error = value === undefined ? undefined : undefined; + const error = undefined; const handler: AmountFieldHandler = { value: value ?? Amounts.zeroOfCurrency("USD"), diff --git a/packages/taler-wallet-webextension/src/wallet/AddContact/views.tsx b/packages/taler-wallet-webextension/src/wallet/AddContact/views.tsx @@ -193,7 +193,7 @@ export function ConfirmAddContactView({ <SmallText style={{ marginTop: 5 }}> <b><i18n.Translate>Mailbox service</i18n.Translate></b>: {contact.mailboxBaseUri} </SmallText> - <SmallText style={{ marginTop: 5, marginBotton: 5 }}> + <SmallText style={{ marginTop: 5, marginBottom: 5 }}> <b><i18n.Translate>Mailbox address</i18n.Translate></b>: {contact.mailboxAddress.toUpperCase().slice(0,8)}[...] </SmallText> {(contact.source) && ( diff --git a/packages/taler-wallet-webextension/src/wallet/ManageAccount/views.tsx b/packages/taler-wallet-webextension/src/wallet/ManageAccount/views.tsx @@ -540,9 +540,9 @@ function translateIbanError( case ParseIbanError.UNSUPPORTED_COUNTRY: return i18n.str`Unsupported country.`; case ParseIbanError.TOO_LONG: - return i18n.str`IBANs have fewer than 34 characters.`; + return i18n.str`IBANs should have fewer than 34 characters.`; case ParseIbanError.TOO_SHORT: - return i18n.str`IBANs have more than 4 characters.`; + return i18n.str`IBANs should have more than 4 characters.`; case ParseIbanError.INVALID_CHARSET: return i18n.str`It should only contain numbers and letters.`; case ParseIbanError.INVALID_CHECKSUM: