@pollar/react 0.12.1-rc.7 → 0.12.1-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +13 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +65 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +65 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1450,6 +1450,10 @@ interface CosignModalTemplateProps {
|
|
|
1450
1450
|
error: string | null;
|
|
1451
1451
|
/** Approve stays off for a request whose approval just failed. */
|
|
1452
1452
|
approveBlocked?: boolean;
|
|
1453
|
+
/** This device is not one of the wallet's devices: it cannot vote, only reject, until it is added. */
|
|
1454
|
+
deviceNotLinked?: boolean;
|
|
1455
|
+
/** Opens where this device gets added; the button shows only with it. */
|
|
1456
|
+
onLinkDevice?: () => void;
|
|
1453
1457
|
/** The last request that reached a final state, shown once the list is empty. */
|
|
1454
1458
|
lastResolved?: CosignRequest;
|
|
1455
1459
|
/** Explorer page of {@link lastResolved}'s transaction, when it was sent. */
|
|
@@ -1467,7 +1471,7 @@ interface CosignModalTemplateProps {
|
|
|
1467
1471
|
onReject: (request: CosignRequest) => void;
|
|
1468
1472
|
onClose: () => void;
|
|
1469
1473
|
}
|
|
1470
|
-
declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, lastResolved, explorerUrl, closesIn, nextStep, language: languageProp, network, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1474
|
+
declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, deviceNotLinked, onLinkDevice, lastResolved, explorerUrl, closesIn, nextStep, language: languageProp, network, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1471
1475
|
|
|
1472
1476
|
interface CustodyMigrationModalProps {
|
|
1473
1477
|
state: CustodyMigrationState;
|
package/dist/index.d.ts
CHANGED
|
@@ -1450,6 +1450,10 @@ interface CosignModalTemplateProps {
|
|
|
1450
1450
|
error: string | null;
|
|
1451
1451
|
/** Approve stays off for a request whose approval just failed. */
|
|
1452
1452
|
approveBlocked?: boolean;
|
|
1453
|
+
/** This device is not one of the wallet's devices: it cannot vote, only reject, until it is added. */
|
|
1454
|
+
deviceNotLinked?: boolean;
|
|
1455
|
+
/** Opens where this device gets added; the button shows only with it. */
|
|
1456
|
+
onLinkDevice?: () => void;
|
|
1453
1457
|
/** The last request that reached a final state, shown once the list is empty. */
|
|
1454
1458
|
lastResolved?: CosignRequest;
|
|
1455
1459
|
/** Explorer page of {@link lastResolved}'s transaction, when it was sent. */
|
|
@@ -1467,7 +1471,7 @@ interface CosignModalTemplateProps {
|
|
|
1467
1471
|
onReject: (request: CosignRequest) => void;
|
|
1468
1472
|
onClose: () => void;
|
|
1469
1473
|
}
|
|
1470
|
-
declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, lastResolved, explorerUrl, closesIn, nextStep, language: languageProp, network, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1474
|
+
declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, deviceNotLinked, onLinkDevice, lastResolved, explorerUrl, closesIn, nextStep, language: languageProp, network, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1471
1475
|
|
|
1472
1476
|
interface CustodyMigrationModalProps {
|
|
1473
1477
|
state: CustodyMigrationState;
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
var core = require('@pollar/core');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var reactDom = require('react-dom');
|
|
7
8
|
var browser = require('@simplewebauthn/browser');
|
|
8
9
|
|
|
9
10
|
var __create = Object.create;
|
|
@@ -1281,7 +1282,7 @@ var PollarModalFooter = ({ language: languageProp }) => {
|
|
|
1281
1282
|
/* @__PURE__ */ jsxRuntime.jsx("img", { src: LOGO_POLLAR_WORDMARK_ON_DARK, alt: "Pollar", className: "pollar-footer-logo pollar-logo-on-dark" }),
|
|
1282
1283
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pollar-footer-version", children: [
|
|
1283
1284
|
"v",
|
|
1284
|
-
"0.12.1-rc.
|
|
1285
|
+
"0.12.1-rc.8"
|
|
1285
1286
|
] })
|
|
1286
1287
|
] });
|
|
1287
1288
|
};
|
|
@@ -1798,6 +1799,20 @@ function DistributionRulesModalTemplate({
|
|
|
1798
1799
|
}
|
|
1799
1800
|
);
|
|
1800
1801
|
}
|
|
1802
|
+
var noSubscription = () => () => {
|
|
1803
|
+
};
|
|
1804
|
+
function PollarOverlay({ style, onClick, children }) {
|
|
1805
|
+
const canPortal = react.useSyncExternalStore(
|
|
1806
|
+
noSubscription,
|
|
1807
|
+
() => true,
|
|
1808
|
+
() => false
|
|
1809
|
+
);
|
|
1810
|
+
if (!canPortal) return null;
|
|
1811
|
+
return reactDom.createPortal(
|
|
1812
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "pollar-overlay", "data-react-aria-top-layer": "true", style, onClick, children }),
|
|
1813
|
+
document.body
|
|
1814
|
+
);
|
|
1815
|
+
}
|
|
1801
1816
|
function DistributionRulesModal({ onClose }) {
|
|
1802
1817
|
const { getClient, styles } = usePollar();
|
|
1803
1818
|
const { theme, accentColor, styleOverrides, overlayStyle } = modalChrome(styles);
|
|
@@ -1845,7 +1860,7 @@ function DistributionRulesModal({ onClose }) {
|
|
|
1845
1860
|
},
|
|
1846
1861
|
[getClient, copy]
|
|
1847
1862
|
);
|
|
1848
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1863
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1849
1864
|
DistributionRulesModalTemplate,
|
|
1850
1865
|
{
|
|
1851
1866
|
theme,
|
|
@@ -2343,7 +2358,7 @@ function EnabledAssetsModal({ onClose }) {
|
|
|
2343
2358
|
},
|
|
2344
2359
|
[runAction]
|
|
2345
2360
|
);
|
|
2346
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2361
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: view === "list" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2347
2362
|
EnabledAssetsModalTemplate,
|
|
2348
2363
|
{
|
|
2349
2364
|
theme,
|
|
@@ -2932,7 +2947,7 @@ function KycModal({
|
|
|
2932
2947
|
if (selectedProvider) void handleSelectProvider(selectedProvider);
|
|
2933
2948
|
else setStep("select_provider");
|
|
2934
2949
|
}
|
|
2935
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2950
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2936
2951
|
KycModalTemplate,
|
|
2937
2952
|
{
|
|
2938
2953
|
theme,
|
|
@@ -3091,7 +3106,7 @@ function RequirementFormModal({
|
|
|
3091
3106
|
if (mounted.current) setSubmitting(false);
|
|
3092
3107
|
}
|
|
3093
3108
|
}
|
|
3094
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3109
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3095
3110
|
"div",
|
|
3096
3111
|
{
|
|
3097
3112
|
className: "pollar-modal-card pollar-form-modal",
|
|
@@ -4064,7 +4079,7 @@ function LoginModal({ onClose }) {
|
|
|
4064
4079
|
getClient().login({ provider });
|
|
4065
4080
|
}
|
|
4066
4081
|
}
|
|
4067
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4082
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: handleClose, children: configStatus !== "ready" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4068
4083
|
LoginModalStatus,
|
|
4069
4084
|
{
|
|
4070
4085
|
status: configStatus === "error" ? "error" : "loading",
|
|
@@ -5617,7 +5632,7 @@ function RegistryCheckModal({
|
|
|
5617
5632
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pollar-form-label", children: label }),
|
|
5618
5633
|
/* @__PURE__ */ jsxRuntime.jsx("input", { className: "pollar-input", value, readOnly: true, disabled: true })
|
|
5619
5634
|
] });
|
|
5620
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5635
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5621
5636
|
"div",
|
|
5622
5637
|
{
|
|
5623
5638
|
className: "pollar-modal-card pollar-form-modal",
|
|
@@ -5797,7 +5812,7 @@ function ProviderRegistrationModal({
|
|
|
5797
5812
|
}
|
|
5798
5813
|
);
|
|
5799
5814
|
}
|
|
5800
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5815
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5801
5816
|
"div",
|
|
5802
5817
|
{
|
|
5803
5818
|
className: "pollar-modal-card pollar-form-modal",
|
|
@@ -6419,7 +6434,7 @@ function RampWidget({ onClose, language: languageProp, initial }) {
|
|
|
6419
6434
|
}
|
|
6420
6435
|
);
|
|
6421
6436
|
}
|
|
6422
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6437
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6423
6438
|
RampWidgetTemplate,
|
|
6424
6439
|
{
|
|
6425
6440
|
language,
|
|
@@ -6816,7 +6831,7 @@ function ReceiveModal({ onClose, initial }) {
|
|
|
6816
6831
|
}, 2e3);
|
|
6817
6832
|
});
|
|
6818
6833
|
}
|
|
6819
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6834
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6820
6835
|
ReceiveModalTemplate,
|
|
6821
6836
|
{
|
|
6822
6837
|
theme,
|
|
@@ -8277,7 +8292,7 @@ function SendModal({ onClose, initial }) {
|
|
|
8277
8292
|
setShowXdr(false);
|
|
8278
8293
|
setCopied(false);
|
|
8279
8294
|
}
|
|
8280
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8295
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: !isInProgress ? onClose : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8281
8296
|
SendModalTemplate,
|
|
8282
8297
|
{
|
|
8283
8298
|
theme,
|
|
@@ -9297,7 +9312,7 @@ function SwapModal({ onClose, initial }) {
|
|
|
9297
9312
|
setShowXdr(false);
|
|
9298
9313
|
setCopied(false);
|
|
9299
9314
|
}
|
|
9300
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9315
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: !isInProgress ? onClose : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9301
9316
|
SwapModalTemplate,
|
|
9302
9317
|
{
|
|
9303
9318
|
theme,
|
|
@@ -9931,7 +9946,7 @@ function BridgeModal({ onClose, initial }) {
|
|
|
9931
9946
|
void refreshWalletBalance();
|
|
9932
9947
|
}
|
|
9933
9948
|
const step = transfer ? "transfer" : !config && !configError ? "loading" : config && (!config.available || sources.length === 0) ? "unavailable" : "form";
|
|
9934
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9949
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9935
9950
|
BridgeModalTemplate,
|
|
9936
9951
|
{
|
|
9937
9952
|
theme,
|
|
@@ -10290,7 +10305,7 @@ function EarnModal({ onClose, initial }) {
|
|
|
10290
10305
|
}
|
|
10291
10306
|
}
|
|
10292
10307
|
const title = step === "form" ? copy.title : txTitle;
|
|
10293
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10308
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: !isInProgress ? onClose : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10294
10309
|
"div",
|
|
10295
10310
|
{
|
|
10296
10311
|
className: "pollar-modal-card pollar-send-modal",
|
|
@@ -11415,7 +11430,7 @@ function CardModal({ onClose, initial }) {
|
|
|
11415
11430
|
const blocked = requirements?.next ? blockedStepMessage(requirements.next, copy.blocked) : null;
|
|
11416
11431
|
const stepsPending = !!requirements?.next;
|
|
11417
11432
|
const title = panel === "fund" ? copy.title.addFunds : card ? card.nickname ?? copy.title.yourCard : copy.title.getCard;
|
|
11418
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11433
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11419
11434
|
"div",
|
|
11420
11435
|
{
|
|
11421
11436
|
className: "pollar-modal-card pollar-card-modal",
|
|
@@ -12091,7 +12106,7 @@ function SessionsModal({ onClose }) {
|
|
|
12091
12106
|
setSigningOutEverywhere(false);
|
|
12092
12107
|
}
|
|
12093
12108
|
}, [getClient, onClose]);
|
|
12094
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12109
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12095
12110
|
SessionsModalTemplate,
|
|
12096
12111
|
{
|
|
12097
12112
|
theme,
|
|
@@ -12170,6 +12185,8 @@ var COSIGN_COPY = {
|
|
|
12170
12185
|
approve: "Approve",
|
|
12171
12186
|
approving: "Approving...",
|
|
12172
12187
|
genericError: "Something went wrong. Please try again.",
|
|
12188
|
+
deviceNotLinked: "This device isn't linked to your wallet yet, so it can't approve. Add it with a device that already is, your passkey or your email.",
|
|
12189
|
+
linkDevice: "Link this device",
|
|
12173
12190
|
transaction: "Transaction",
|
|
12174
12191
|
operations: {
|
|
12175
12192
|
payment: "Send",
|
|
@@ -12209,6 +12226,8 @@ var COSIGN_COPY = {
|
|
|
12209
12226
|
approve: "Aprobar",
|
|
12210
12227
|
approving: "Aprobando...",
|
|
12211
12228
|
genericError: "Algo sali\xF3 mal. Intenta de nuevo.",
|
|
12229
|
+
deviceNotLinked: "Este dispositivo a\xFAn no est\xE1 vinculado a tu billetera, as\xED que no puede aprobar. Agr\xE9galo con un dispositivo que ya lo est\xE9, tu passkey o tu email.",
|
|
12230
|
+
linkDevice: "Vincular este dispositivo",
|
|
12212
12231
|
transaction: "Transacci\xF3n",
|
|
12213
12232
|
operations: {
|
|
12214
12233
|
payment: "Enviar",
|
|
@@ -12248,6 +12267,8 @@ var COSIGN_COPY = {
|
|
|
12248
12267
|
approve: "Aprovar",
|
|
12249
12268
|
approving: "Aprovando...",
|
|
12250
12269
|
genericError: "Algo deu errado. Tente novamente.",
|
|
12270
|
+
deviceNotLinked: "Este dispositivo ainda n\xE3o est\xE1 vinculado \xE0 sua carteira, ent\xE3o n\xE3o pode aprovar. Adicione-o com um dispositivo que j\xE1 esteja, sua passkey ou seu email.",
|
|
12271
|
+
linkDevice: "Vincular este dispositivo",
|
|
12251
12272
|
transaction: "Transa\xE7\xE3o",
|
|
12252
12273
|
operations: {
|
|
12253
12274
|
payment: "Enviar",
|
|
@@ -12293,6 +12314,8 @@ function CosignModalTemplate({
|
|
|
12293
12314
|
busy,
|
|
12294
12315
|
error,
|
|
12295
12316
|
approveBlocked = false,
|
|
12317
|
+
deviceNotLinked = false,
|
|
12318
|
+
onLinkDevice,
|
|
12296
12319
|
lastResolved,
|
|
12297
12320
|
explorerUrl,
|
|
12298
12321
|
closesIn = null,
|
|
@@ -12307,7 +12330,7 @@ function CosignModalTemplate({
|
|
|
12307
12330
|
const language = useInheritedLanguage(languageProp);
|
|
12308
12331
|
const copy = COSIGN_COPY[language];
|
|
12309
12332
|
const cssVars = buildModalCssVars(theme, accentColor, styleOverrides);
|
|
12310
|
-
const verified = verification?.ok === true;
|
|
12333
|
+
const verified = verification?.ok === true && !deviceNotLinked;
|
|
12311
12334
|
const canVote = !!current && verified && !busy && !approveBlocked;
|
|
12312
12335
|
const [verifiedOpenFor, setVerifiedOpenFor] = react.useState(null);
|
|
12313
12336
|
const verifiedOpen = !!current && verifiedOpenFor === current.id;
|
|
@@ -12392,11 +12415,11 @@ function CosignModalTemplate({
|
|
|
12392
12415
|
current && review && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `pollar-cosign-detail${pending.length > 1 ? " pollar-cosign-detail-grouped" : ""}`, children: [
|
|
12393
12416
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-cosign-detail-head", children: [
|
|
12394
12417
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "pollar-cosign-detail-title", children: review.title }),
|
|
12395
|
-
!verification && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pollar-cosign-chip", children: [
|
|
12418
|
+
!verification && !deviceNotLinked && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pollar-cosign-chip", children: [
|
|
12396
12419
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pollar-spinner pollar-spinner-sm", "aria-hidden": true }),
|
|
12397
12420
|
copy.checking
|
|
12398
12421
|
] }),
|
|
12399
|
-
|
|
12422
|
+
verified && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12400
12423
|
"button",
|
|
12401
12424
|
{
|
|
12402
12425
|
type: "button",
|
|
@@ -12411,8 +12434,11 @@ function CosignModalTemplate({
|
|
|
12411
12434
|
)
|
|
12412
12435
|
] }),
|
|
12413
12436
|
/* @__PURE__ */ jsxRuntime.jsx(TxReview, { data: review, language }, current.id),
|
|
12414
|
-
|
|
12415
|
-
|
|
12437
|
+
verified && verifiedOpen && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pollar-cosign-verify pollar-cosign-verify-ok", children: copy.checkedAgainstTurnkey }),
|
|
12438
|
+
deviceNotLinked ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-cosign-verify pollar-cosign-verify-bad", children: [
|
|
12439
|
+
copy.deviceNotLinked,
|
|
12440
|
+
onLinkDevice && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "pollar-cosign-link", onClick: onLinkDevice, children: copy.linkDevice })
|
|
12441
|
+
] }) : verification && !verification.ok && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pollar-cosign-verify pollar-cosign-verify-bad", children: [
|
|
12416
12442
|
copy.notVerified,
|
|
12417
12443
|
" ",
|
|
12418
12444
|
verification.reason
|
|
@@ -12450,7 +12476,7 @@ var CLOSE_AFTER_SECONDS = 3;
|
|
|
12450
12476
|
var CLOSE_AFTER_SENT_SECONDS = 5;
|
|
12451
12477
|
var NEXT_REQUEST_EVERY_MS = 2e3;
|
|
12452
12478
|
function CosignModal({ nextStep = null, onClose }) {
|
|
12453
|
-
const { getClient, styles, network } = usePollar();
|
|
12479
|
+
const { getClient, styles, network, openRecoveryModal } = usePollar();
|
|
12454
12480
|
const { theme, accentColor, styleOverrides, overlayStyle } = modalChrome(styles);
|
|
12455
12481
|
const { pending, lastResolved, loaded, refresh, approve, reject, verify, inspectQuorum } = useCosign();
|
|
12456
12482
|
const language = useModalLanguage();
|
|
@@ -12460,10 +12486,13 @@ function CosignModal({ nextStep = null, onClose }) {
|
|
|
12460
12486
|
const [error, setError] = react.useState(null);
|
|
12461
12487
|
const [approveFailedFor, setApproveFailedFor] = react.useState(null);
|
|
12462
12488
|
const [quorumFailure, setQuorumFailure] = react.useState(null);
|
|
12489
|
+
const [deviceNotLinked, setDeviceNotLinked] = react.useState(false);
|
|
12463
12490
|
react.useEffect(() => {
|
|
12464
12491
|
let cancelled = false;
|
|
12465
12492
|
inspectQuorum().then((q) => {
|
|
12466
|
-
if (
|
|
12493
|
+
if (cancelled || q.ok) return;
|
|
12494
|
+
if (q.code === "DEVICE_NOT_ENROLLED") setDeviceNotLinked(true);
|
|
12495
|
+
else setQuorumFailure(q.reason);
|
|
12467
12496
|
}).catch(() => void 0);
|
|
12468
12497
|
return () => {
|
|
12469
12498
|
cancelled = true;
|
|
@@ -12541,7 +12570,7 @@ function CosignModal({ nextStep = null, onClose }) {
|
|
|
12541
12570
|
},
|
|
12542
12571
|
[]
|
|
12543
12572
|
);
|
|
12544
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12573
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12545
12574
|
CosignModalTemplate,
|
|
12546
12575
|
{
|
|
12547
12576
|
theme,
|
|
@@ -12553,6 +12582,11 @@ function CosignModal({ nextStep = null, onClose }) {
|
|
|
12553
12582
|
busy,
|
|
12554
12583
|
error,
|
|
12555
12584
|
approveBlocked: !!current && approveFailedFor === current.id,
|
|
12585
|
+
deviceNotLinked,
|
|
12586
|
+
onLinkDevice: () => {
|
|
12587
|
+
onClose();
|
|
12588
|
+
openRecoveryModal();
|
|
12589
|
+
},
|
|
12556
12590
|
...lastResolved ? { lastResolved } : {},
|
|
12557
12591
|
closesIn,
|
|
12558
12592
|
nextStep: awaitingNext ? nextStep : null,
|
|
@@ -12725,7 +12759,7 @@ function CustodyMigrationModal({ state, onMoved, onLater }) {
|
|
|
12725
12759
|
setBusy(false);
|
|
12726
12760
|
}
|
|
12727
12761
|
}
|
|
12728
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12762
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12729
12763
|
CustodyMigrationModalTemplate,
|
|
12730
12764
|
{
|
|
12731
12765
|
theme,
|
|
@@ -13248,7 +13282,7 @@ function RecoveryModal({ onClose }) {
|
|
|
13248
13282
|
[load]
|
|
13249
13283
|
);
|
|
13250
13284
|
const enrolled = !!thisDeviceKey && !!devices?.devices.some((d) => d.publicKey.toLowerCase() === thisDeviceKey);
|
|
13251
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13285
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13252
13286
|
RecoveryModalTemplate,
|
|
13253
13287
|
{
|
|
13254
13288
|
theme,
|
|
@@ -13394,7 +13428,7 @@ function ConfirmModal({ confirmation }) {
|
|
|
13394
13428
|
if (authState.step === "idle") rejectRef.current();
|
|
13395
13429
|
});
|
|
13396
13430
|
}, [getClient]);
|
|
13397
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13431
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: confirmation.reject, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13398
13432
|
"div",
|
|
13399
13433
|
{
|
|
13400
13434
|
className: "pollar-modal-card pollar-cosign-modal",
|
|
@@ -13524,7 +13558,7 @@ function TransactionModal({ onClose }) {
|
|
|
13524
13558
|
await getClient().signAndSubmitTx(transaction.buildData.unsignedXdr);
|
|
13525
13559
|
}
|
|
13526
13560
|
}
|
|
13527
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13561
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13528
13562
|
TransactionModalTemplate,
|
|
13529
13563
|
{
|
|
13530
13564
|
theme,
|
|
@@ -13906,7 +13940,7 @@ function TxHistoryModal({ onClose, initial }) {
|
|
|
13906
13940
|
const paged = (nextOffset) => {
|
|
13907
13941
|
if (selectedChain) load(nextOffset, selectedChain);
|
|
13908
13942
|
};
|
|
13909
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13943
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13910
13944
|
TxHistoryModalTemplate,
|
|
13911
13945
|
{
|
|
13912
13946
|
theme,
|
|
@@ -14137,7 +14171,7 @@ function WalletBalanceModal({ onClose }) {
|
|
|
14137
14171
|
react.useEffect(() => {
|
|
14138
14172
|
void refreshWalletBalance();
|
|
14139
14173
|
}, [refreshWalletBalance]);
|
|
14140
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14174
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PollarOverlay, { style: overlayStyle, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14141
14175
|
WalletBalanceModalTemplate,
|
|
14142
14176
|
{
|
|
14143
14177
|
theme,
|
|
@@ -14461,6 +14495,7 @@ function PollarProvider({
|
|
|
14461
14495
|
if (cosign.pending.length > cosignPendingCount.current) setCosignModalOpen(true);
|
|
14462
14496
|
cosignPendingCount.current = cosign.pending.length;
|
|
14463
14497
|
}, [cosign.pending.length]);
|
|
14498
|
+
react.useEffect(() => pollarClient.onCosignDeviceNotEnrolled(() => setRecoveryModalOpen(true)), [pollarClient]);
|
|
14464
14499
|
const [distributionRulesModalOpen, setDistributionRulesModalOpen] = react.useState(false);
|
|
14465
14500
|
react.useEffect(
|
|
14466
14501
|
() => pollarClient.onAuthStateChange((authState) => {
|