[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: ignore case for taler://
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: ignore case for taler:// |
Date: |
Thu, 29 Aug 2024 16:42:58 +0200 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 551aa1a5e ignore case for taler://
551aa1a5e is described below
commit 551aa1a5e7e7e3a390a472fa433387da8bf3fc72
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Thu Aug 29 11:42:34 2024 -0300
ignore case for taler://
---
.../src/wallet/AddNewActionView.tsx | 2 +-
.../src/wallet/Application.tsx | 169 +++++++++++----------
.../src/wallet/QrReader.tsx | 6 +-
3 files changed, 96 insertions(+), 81 deletions(-)
diff --git a/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx
b/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx
index dd1777fd1..62f1ffbb1 100644
--- a/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx
@@ -27,7 +27,7 @@ export interface Props {
export function AddNewActionView({ onCancel }: Props): VNode {
const [url, setUrl] = useState("");
- const uri = parseTalerUri(url);
+ const uri = parseTalerUri(url.toLowerCase());
const { i18n } = useTranslationContext();
async function redirectToWallet(): Promise<void> {
diff --git a/packages/taler-wallet-webextension/src/wallet/Application.tsx
b/packages/taler-wallet-webextension/src/wallet/Application.tsx
index 90102dc09..768b82073 100644
--- a/packages/taler-wallet-webextension/src/wallet/Application.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Application.tsx
@@ -131,7 +131,9 @@ export function Application(): VNode {
onDetected={(talerActionUrl: TalerUri) => {
redirectTo(
Pages.defaultCta({
- uri:
encodeCrockForURI(stringifyTalerUri(talerActionUrl)),
+ uri: encodeCrockForURI(
+ stringifyTalerUri(talerActionUrl),
+ ),
}),
);
}}
@@ -188,14 +190,18 @@ export function Application(): VNode {
goToWalletDeposit={(scope: ScopeInfo) =>
redirectTo(
Pages.sendCash({
- scope:
encodeCrockForURI(stringifyScopeInfoShort(scope)),
+ scope: encodeCrockForURI(
+ stringifyScopeInfoShort(scope),
+ ),
}),
)
}
goToWalletManualWithdraw={(scope?: ScopeInfo) =>
redirectTo(
Pages.receiveCash({
- scope: !scope ? undefined :
encodeCrockForURI(stringifyScopeInfoShort(scope)),
+ scope: !scope
+ ? undefined
+ : encodeCrockForURI(stringifyScopeInfoShort(scope)),
}),
)
}
@@ -221,14 +227,18 @@ export function Application(): VNode {
goToWalletDeposit={(scope: ScopeInfo) =>
redirectTo(
Pages.sendCash({
- scope:
encodeCrockForURI(stringifyScopeInfoShort(scope)),
+ scope: encodeCrockForURI(
+ stringifyScopeInfoShort(scope),
+ ),
}),
)
}
goToWalletManualWithdraw={(scope?: ScopeInfo) =>
redirectTo(
Pages.receiveCash({
- scope: !scope ? undefined :
encodeCrockForURI(stringifyScopeInfoShort(scope)),
+ scope: !scope
+ ? undefined
+ : encodeCrockForURI(stringifyScopeInfoShort(scope)),
}),
)
}
@@ -238,11 +248,7 @@ export function Application(): VNode {
/>
<Route
path={Pages.sendCash.pattern}
- component={({
- scope,
- }: {
- scope?: string;
- }) => {
+ component={({ scope }: { scope?: string }) => {
if (!scope) return <Redirect to={Pages.balanceHistory({})} />;
const s = parseScopeInfoShort(decodeCrockFromURI(scope));
if (!s) return <Redirect to={Pages.balanceHistory({})} />;
@@ -281,26 +287,32 @@ export function Application(): VNode {
/>
<Route
path={Pages.bankManange.pattern}
- component={({
- scope,
- }: {
- scope?: string;
- }) => {
- const s = !scope ? undefined :
parseScopeInfoShort(decodeCrockFromURI(scope));
- if (!s) return <div>missing scope</div>
+ component={({ scope }: { scope?: string }) => {
+ const s = !scope
+ ? undefined
+ : parseScopeInfoShort(decodeCrockFromURI(scope));
+ if (!s) return <div>missing scope</div>;
return (
<WalletTemplate path="balance" goToURL={redirectToURL}>
<ManageAccountPage
scope={s}
- onAccountAdded={(account) => redirectTo(Pages.ctaDeposit({
- scope: encodeCrockForURI(stringifyScopeInfoShort(s)),
- account: encodeCrockForURI(stringifyPaytoUri(account)),
- }))}
+ onAccountAdded={(account) =>
+ redirectTo(
+ Pages.ctaDeposit({
+ scope: encodeCrockForURI(stringifyScopeInfoShort(s)),
+ account: encodeCrockForURI(
+ stringifyPaytoUri(account),
+ ),
+ }),
+ )
+ }
onCancel={() => {
- redirectTo(Pages.balanceHistory({
- scope: encodeCrockForURI(stringifyScopeInfoShort(s)),
- }))
+ redirectTo(
+ Pages.balanceHistory({
+ scope: encodeCrockForURI(stringifyScopeInfoShort(s)),
+ }),
+ );
}}
/>
</WalletTemplate>
@@ -329,11 +341,7 @@ export function Application(): VNode {
/>
<Route
path={Pages.receiveCash.pattern}
- component={({
- scope,
- }: {
- scope?: string;
- }) => {
+ component={({ scope }: { scope?: string }) => {
const s = !scope
? undefined
: parseScopeInfoShort(decodeCrockFromURI(scope));
@@ -343,14 +351,14 @@ export function Application(): VNode {
<DestinationSelectionPage
type="get"
scope={s}
- goToWalletManualWithdraw={(s,) =>
+ goToWalletManualWithdraw={(s) =>
redirectTo(
Pages.ctaWithdrawManual({
scope: encodeCrockForURI(stringifyScopeInfoShort(s)),
}),
)
}
- goToWalletWalletInvoice={(s,) =>
+ goToWalletWalletInvoice={(s) =>
redirectTo(
Pages.ctaInvoiceCreate({
scope: encodeCrockForURI(stringifyScopeInfoShort(s)),
@@ -372,7 +380,9 @@ export function Application(): VNode {
goToWalletHistory={(scope: ScopeInfo) =>
redirectTo(
Pages.balanceHistory({
- scope:
encodeCrockForURI(stringifyScopeInfoShort(scope)),
+ scope: encodeCrockForURI(
+ stringifyScopeInfoShort(scope),
+ ),
}),
)
}
@@ -383,34 +393,36 @@ export function Application(): VNode {
<Route
path={Pages.balanceDeposit.pattern}
- component={({
- scope,
- }: {
- scope: string;
- }) => {
- const s = parseScopeInfoShort(decodeCrockFromURI(scope))
+ component={({ scope }: { scope: string }) => {
+ const s = parseScopeInfoShort(decodeCrockFromURI(scope));
if (!s) {
- return <div>missing scope</div>
+ return <div>missing scope</div>;
}
- return <WalletTemplate path="balance" goToURL={redirectToURL}>
- <DepositPage
- scope={s}
- onCancel={(scope: ScopeInfo) => {
- redirectTo(
- Pages.balanceHistory({
- scope:
encodeCrockForURI(stringifyScopeInfoShort(scope)),
- }),
- );
- }}
- onSuccess={(scope: ScopeInfo) => {
- redirectTo(
- Pages.balanceHistory({
- scope:
encodeCrockForURI(stringifyScopeInfoShort(scope)),
- }),
- );
- }}
- />
- </WalletTemplate>
+ return (
+ <WalletTemplate path="balance" goToURL={redirectToURL}>
+ <DepositPage
+ scope={s}
+ onCancel={(scope: ScopeInfo) => {
+ redirectTo(
+ Pages.balanceHistory({
+ scope: encodeCrockForURI(
+ stringifyScopeInfoShort(scope),
+ ),
+ }),
+ );
+ }}
+ onSuccess={(scope: ScopeInfo) => {
+ redirectTo(
+ Pages.balanceHistory({
+ scope: encodeCrockForURI(
+ stringifyScopeInfoShort(scope),
+ ),
+ }),
+ );
+ }}
+ />
+ </WalletTemplate>
+ );
}}
/>
@@ -624,30 +636,31 @@ export function Application(): VNode {
scope,
account,
}: {
- scope: string,
+ scope: string;
account: string;
}) => {
- const s = parseScopeInfoShort(decodeCrockFromURI(scope))
+ const s = parseScopeInfoShort(decodeCrockFromURI(scope));
if (!s) {
- return <div>missing scope</div>
+ return <div>missing scope</div>;
}
- const p = parsePaytoUri(decodeCrockFromURI(account))
+ const p = parsePaytoUri(decodeCrockFromURI(account));
if (!p) {
- return <div>missing account</div>
+ return <div>missing account</div>;
}
- return <CallToActionTemplate title={i18n.str`Digital cash
deposit`} >
- <DepositPageCTA
- scope={s}
- account={p}
- cancel={() => redirectTo(Pages.balance)}
- onSuccess={(tid: string) =>
- redirectTo(Pages.balanceTransaction({ tid }))
- }
- />
- </CallToActionTemplate>
- }
- }
+ return (
+ <CallToActionTemplate title={i18n.str`Digital cash deposit`}>
+ <DepositPageCTA
+ scope={s}
+ account={p}
+ cancel={() => redirectTo(Pages.balance)}
+ onSuccess={(tid: string) =>
+ redirectTo(Pages.balanceTransaction({ tid }))
+ }
+ />
+ </CallToActionTemplate>
+ );
+ }}
/>
<Route
path={Pages.ctaInvoiceCreate.pattern}
@@ -736,7 +749,9 @@ export function Application(): VNode {
<Route
path={Pages.ctaAddExchange}
component={({ talerUri }: { talerUri: string }) => {
- const tUri = parseTalerUri(decodeCrockFromURI(talerUri));
+ const tUri = parseTalerUri(
+ decodeCrockFromURI(talerUri).toLowerCase(),
+ );
const baseUrl =
tUri?.type === TalerUriAction.AddExchange
? tUri.exchangeBaseUrl
@@ -776,7 +791,7 @@ export function Application(): VNode {
<WalletActivity />
</EnabledBySettings>
</IoCProviderForRuntime>
- </TranslationProvider >
+ </TranslationProvider>
);
}
diff --git a/packages/taler-wallet-webextension/src/wallet/QrReader.tsx
b/packages/taler-wallet-webextension/src/wallet/QrReader.tsx
index a01ea6967..9635cd077 100644
--- a/packages/taler-wallet-webextension/src/wallet/QrReader.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/QrReader.tsx
@@ -216,7 +216,7 @@ export function QrReaderPage({ onDetected }: Props): VNode {
function onChangeDetect(str: string) {
if (str) {
- const uri = parseTalerUri(str);
+ const uri = parseTalerUri(str.toLowerCase());
if (!uri) {
setError(
i18n.str`URI is not valid. Taler URI should start with "taler://"`,
@@ -233,7 +233,7 @@ export function QrReaderPage({ onDetected }: Props): VNode {
function onChange(str: string) {
if (str) {
- if (!parseTalerUri(str)) {
+ if (!parseTalerUri(str.toLowerCase())) {
setError(
i18n.str`URI is not valid. Taler URI should start with "taler://"`,
);
@@ -293,7 +293,7 @@ export function QrReaderPage({ onDetected }: Props): VNode {
setError(i18n.str`something unexpected happen: ${error}`);
}
}
- const uri = parseTalerUri(value);
+ const uri = parseTalerUri(value.toLowerCase());
return (
<Container>
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: ignore case for taler://,
gnunet <=