mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-02-23 07:04:19 +01:00
include nwc string in url callback
This commit is contained in:
@@ -42,9 +42,11 @@ export function NWCBudgetEditor(props: {
|
||||
|
||||
// If there's an initial profile, look at that, otherwise default to false
|
||||
const auto_approve =
|
||||
props.initialProfile?.require_approval !== undefined
|
||||
props.initialAmount !== undefined ||
|
||||
props.initialInterval !== undefined ||
|
||||
(props.initialProfile?.require_approval !== undefined
|
||||
? !props.initialProfile?.require_approval
|
||||
: false;
|
||||
: false);
|
||||
|
||||
// prop amount -> profile editing -> subscriptions -> 0
|
||||
// (ternaries take precendence so I put it in parens)
|
||||
|
||||
@@ -308,7 +308,14 @@ function Nwc() {
|
||||
// If there's a "return_to" param we use that instead of the callbackUri scheme
|
||||
const returnUrl = searchParams.return_to;
|
||||
if (returnUrl) {
|
||||
setCallbackUri(returnUrl);
|
||||
// add the nwc query param to the return url
|
||||
const fullURI =
|
||||
returnUrl +
|
||||
(returnUrl.includes("?") ? "&" : "?") +
|
||||
"nwc=" +
|
||||
encodeURIComponent(newProfile.nwc_uri);
|
||||
|
||||
setCallbackUri(fullURI);
|
||||
setCallbackDialogOpen(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user