mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-28 08:22:24 +00:00
Merge pull request #1295 from PR0M3TH3AN/jules-7892265785675999514-a989ee17
feat(ui): update zap dialog to show "Done" button on success
This commit is contained in:
4 files changed
+118
-61
No files matched your search
@@ -2405,6 +2405,28 @@ function resetZapRetryState() {
|
||||
}
|
||||
}
|
||||
|
||||
function setZapCompleted(completed) {
|
||||
const sendButton = getZapSendButton();
|
||||
if (!sendButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (completed) {
|
||||
delete sendButton.dataset.retryPending;
|
||||
sendButton.dataset.completed = "true";
|
||||
sendButton.textContent = "Done";
|
||||
sendButton.setAttribute("aria-label", "Close zap dialog");
|
||||
sendButton.title = "Close zap dialog";
|
||||
} else {
|
||||
delete sendButton.dataset.completed;
|
||||
if (!sendButton.dataset.retryPending) {
|
||||
sendButton.textContent = "Send";
|
||||
sendButton.setAttribute("aria-label", "Send a zap");
|
||||
sendButton.removeAttribute("title");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function markZapRetryPending(shares) {
|
||||
const validShares = Array.isArray(shares)
|
||||
? shares.filter((share) => share && share.amount > 0)
|
||||
@@ -2786,6 +2808,7 @@ async function runZapAttempt({ amount, overrideFee = null, walletSettings }) {
|
||||
|
||||
function handleZapAmountChange() {
|
||||
resetZapRetryState();
|
||||
setZapCompleted(false);
|
||||
updateZapSplitSummary();
|
||||
}
|
||||
|
||||
@@ -2935,6 +2958,11 @@ async function handleZapSend(event) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (sendButton.dataset.completed === "true") {
|
||||
closeZapControls({ focusButton: true });
|
||||
return;
|
||||
}
|
||||
|
||||
if (!zapPopover || zapPopoverTrigger !== zapButton) {
|
||||
setupZapButton({ force: true });
|
||||
}
|
||||
@@ -3096,6 +3124,7 @@ async function handleZapSend(event) {
|
||||
setZapStatus(summary, "success");
|
||||
app?.showSuccess?.("Zap sent successfully!");
|
||||
resetZapRetryState();
|
||||
setZapCompleted(true);
|
||||
} catch (error) {
|
||||
const tracker = Array.isArray(error?.__zapShareTracker)
|
||||
? error.__zapShareTracker
|
||||
|
||||
@@ -398,7 +398,7 @@ export default class ZapController {
|
||||
|
||||
this.resetRetryState();
|
||||
this.modalZapCommentValue = "";
|
||||
this.videoModal?.resetZapForm({ amount: "", comment: "" });
|
||||
this.videoModal?.setZapComment("");
|
||||
this.videoModal?.setZapCompleted(true);
|
||||
this.applyDefaultAmount();
|
||||
} catch (error) {
|
||||
|
||||
Generated
+87
-59
@@ -28,7 +28,7 @@
|
||||
"postcss": "^8.4.41",
|
||||
"prettier": "^3.3.3",
|
||||
"prettier-plugin-tailwindcss": "^0.6.5",
|
||||
"stylelint": "^16.8.0",
|
||||
"stylelint": "^16.26.1",
|
||||
"stylelint-config-standard": "^36.0.1",
|
||||
"tailwindcss": "^3.4.19"
|
||||
}
|
||||
@@ -85,38 +85,28 @@
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@cacheable/memoize": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@cacheable/memoize/-/memoize-2.0.3.tgz",
|
||||
"integrity": "sha512-hl9wfQgpiydhQEIv7fkjEzTGE+tcosCXLKFDO707wYJ/78FVOlowb36djex5GdbSyeHnG62pomYLMuV/OT8Pbw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@cacheable/utils": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@cacheable/memory": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@cacheable/memory/-/memory-2.0.3.tgz",
|
||||
"integrity": "sha512-R3UKy/CKOyb1LZG/VRCTMcpiMDyLH7SH3JrraRdK6kf3GweWCOU3sgvE13W3TiDRbxnDKylzKJvhUAvWl9LQOA==",
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@cacheable/memory/-/memory-2.0.7.tgz",
|
||||
"integrity": "sha512-RbxnxAMf89Tp1dLhXMS7ceft/PGsDl1Ip7T20z5nZ+pwIAsQ1p2izPjVG69oCLv/jfQ7HDPHTWK0c9rcAWXN3A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@cacheable/memoize": "^2.0.3",
|
||||
"@cacheable/utils": "^2.0.3",
|
||||
"@keyv/bigmap": "^1.0.2",
|
||||
"hookified": "^1.12.1",
|
||||
"keyv": "^5.5.3"
|
||||
"@cacheable/utils": "^2.3.3",
|
||||
"@keyv/bigmap": "^1.3.0",
|
||||
"hookified": "^1.14.0",
|
||||
"keyv": "^5.5.5"
|
||||
}
|
||||
},
|
||||
"node_modules/@cacheable/utils": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@cacheable/utils/-/utils-2.1.0.tgz",
|
||||
"integrity": "sha512-ZdxfOiaarMqMj+H7qwlt5EBKWaeGihSYVHdQv5lUsbn8MJJOTW82OIwirQ39U5tMZkNvy3bQE+ryzC+xTAb9/g==",
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@cacheable/utils/-/utils-2.3.3.tgz",
|
||||
"integrity": "sha512-JsXDL70gQ+1Vc2W/KUFfkAJzgb4puKwwKehNLuB+HrNKWf91O736kGfxn4KujXCCSuh6mRRL4XEB0PkAFjWS0A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"keyv": "^5.5.3"
|
||||
"hashery": "^1.3.0",
|
||||
"keyv": "^5.5.5"
|
||||
}
|
||||
},
|
||||
"node_modules/@csstools/color-helpers": {
|
||||
@@ -215,6 +205,26 @@
|
||||
"@csstools/css-tokenizer": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@csstools/css-syntax-patches-for-csstree": {
|
||||
"version": "1.0.25",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.0.25.tgz",
|
||||
"integrity": "sha512-g0Kw9W3vjx5BEBAF8c5Fm2NcB/Fs8jJXh85aXqwEXiL+tqtOut07TWgyaGzAAfTM+gKckrrncyeGEZPcaRgm2Q==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/csstools"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/csstools"
|
||||
}
|
||||
],
|
||||
"license": "MIT-0",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@csstools/css-tokenizer": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz",
|
||||
@@ -796,16 +806,20 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@keyv/bigmap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.0.2.tgz",
|
||||
"integrity": "sha512-KR03xkEZlAZNF4IxXgVXb+uNIVNvwdh8UwI0cnc7WI6a+aQcDp8GL80qVfeB4E5NpsKJzou5jU0r6yLSSbMOtA==",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.3.0.tgz",
|
||||
"integrity": "sha512-KT01GjzV6AQD5+IYrcpoYLkCu1Jod3nau1Z7EsEuViO3TZGRacSbO9MfHmbJ1WaOXFtWLxPVj169cn2WNKPkIg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"hookified": "^1.12.1"
|
||||
"hashery": "^1.2.0",
|
||||
"hookified": "^1.13.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"keyv": "^5.5.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@keyv/serialize": {
|
||||
@@ -1655,18 +1669,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/cacheable": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.1.0.tgz",
|
||||
"integrity": "sha512-zzL1BxdnqwD69JRT0dihnawAcLkBMwAH+hZSKjUzeBbPedVhk3qYPjRw9VOMYWwt5xRih5xd8S+3kEdGohZm/g==",
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.3.2.tgz",
|
||||
"integrity": "sha512-w+ZuRNmex9c1TR9RcsxbfTKCjSL0rh1WA5SABbrWprIHeNBdmyQLSYonlDy9gpD+63XT8DgZ/wNh1Smvc9WnJA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@cacheable/memoize": "^2.0.3",
|
||||
"@cacheable/memory": "^2.0.3",
|
||||
"@cacheable/utils": "^2.1.0",
|
||||
"hookified": "^1.12.1",
|
||||
"keyv": "^5.5.3",
|
||||
"qified": "^0.5.0"
|
||||
"@cacheable/memory": "^2.0.7",
|
||||
"@cacheable/utils": "^2.3.3",
|
||||
"hookified": "^1.15.0",
|
||||
"keyv": "^5.5.5",
|
||||
"qified": "^0.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
@@ -2494,13 +2507,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/file-entry-cache": {
|
||||
"version": "10.1.4",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-10.1.4.tgz",
|
||||
"integrity": "sha512-5XRUFc0WTtUbjfGzEwXc42tiGxQHBmtbUG1h9L2apu4SulCGN3Hqm//9D6FAolf8MYNL7f/YlJl9vy08pj5JuA==",
|
||||
"version": "11.1.2",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-11.1.2.tgz",
|
||||
"integrity": "sha512-N2WFfK12gmrK1c1GXOqiAJ1tc5YE+R53zvQ+t5P8S5XhnmKYVB5eZEiLNZKDSmoG8wqqbF9EXYBBW/nef19log==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"flat-cache": "^6.1.13"
|
||||
"flat-cache": "^6.1.20"
|
||||
}
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
@@ -2517,15 +2530,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/flat-cache": {
|
||||
"version": "6.1.17",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-6.1.17.tgz",
|
||||
"integrity": "sha512-Jzse4YoiUJBVYTwz5Bwl4h/2VQM7e2KK3MVAMlXzX9uamIHAH/TXUlRKU1AQGQOryQhN0EsmufiiF40G057YXA==",
|
||||
"version": "6.1.20",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-6.1.20.tgz",
|
||||
"integrity": "sha512-AhHYqwvN62NVLp4lObVXGVluiABTHapoB57EyegZVmazN+hhGhLTn3uZbOofoTw4DSDvVCadzzyChXhOAvy8uQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cacheable": "^2.0.3",
|
||||
"cacheable": "^2.3.2",
|
||||
"flatted": "^3.3.3",
|
||||
"hookified": "^1.12.0"
|
||||
"hookified": "^1.15.0"
|
||||
}
|
||||
},
|
||||
"node_modules/flatted": {
|
||||
@@ -2863,6 +2876,19 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hashery": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/hashery/-/hashery-1.4.0.tgz",
|
||||
"integrity": "sha512-Wn2i1In6XFxl8Az55kkgnFRiAlIAushzh26PTjL2AKtQcEfXrcLa7Hn5QOWGZEf3LU057P9TwwZjFyxfS1VuvQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"hookified": "^1.14.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
@@ -2877,9 +2903,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/hookified": {
|
||||
"version": "1.12.1",
|
||||
"resolved": "https://registry.npmjs.org/hookified/-/hookified-1.12.1.tgz",
|
||||
"integrity": "sha512-xnKGl+iMIlhrZmGHB729MqlmPoWBznctSQTYCpFKqNsCgimJQmithcW0xSQMMFzYnV2iKUh25alswn6epgxS0Q==",
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/hookified/-/hookified-1.15.0.tgz",
|
||||
"integrity": "sha512-51w+ZZGt7Zw5q7rM3nC4t3aLn/xvKDETsXqMczndvwyVQhAHfUmUuFBRFcos8Iyebtk7OAE9dL26wFNzZVVOkw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -3356,11 +3382,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/keyv": {
|
||||
"version": "5.5.3",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-5.5.3.tgz",
|
||||
"integrity": "sha512-h0Un1ieD+HUrzBH6dJXhod3ifSghk5Hw/2Y4/KHBziPlZecrFyE9YOTPU6eOs0V9pYl8gOs86fkr/KN8lUX39A==",
|
||||
"version": "5.5.5",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-5.5.5.tgz",
|
||||
"integrity": "sha512-FA5LmZVF1VziNc0bIdCSA1IoSVnDCqE8HJIZZv2/W8YmoAM50+tnUgJR/gQZwEeIMleuIOnRnHA/UaZRNeV4iQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@keyv/serialize": "^1.1.1"
|
||||
}
|
||||
@@ -4498,13 +4525,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/qified": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/qified/-/qified-0.5.0.tgz",
|
||||
"integrity": "sha512-Zj6Q/Vc/SQ+Fzc87N90jJUzBzxD7MVQ2ZvGyMmYtnl2u1a07CejAhvtk4ZwASos+SiHKCAIylyGHJKIek75QBw==",
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/qified/-/qified-0.6.0.tgz",
|
||||
"integrity": "sha512-tsSGN1x3h569ZSU1u6diwhltLyfUWDp3YbFHedapTmpBl0B3P6U3+Qptg7xu+v+1io1EwhdPyyRHYbEw0KN2FA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"hookified": "^1.12.1"
|
||||
"hookified": "^1.14.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
@@ -5335,9 +5362,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/stylelint": {
|
||||
"version": "16.25.0",
|
||||
"resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.25.0.tgz",
|
||||
"integrity": "sha512-Li0avYWV4nfv1zPbdnxLYBGq4z8DVZxbRgx4Kn6V+Uftz1rMoF1qiEI3oL4kgWqyYgCgs7gT5maHNZ82Gk03vQ==",
|
||||
"version": "16.26.1",
|
||||
"resolved": "https://registry.npmjs.org/stylelint/-/stylelint-16.26.1.tgz",
|
||||
"integrity": "sha512-v20V59/crfc8sVTAtge0mdafI3AdnzQ2KsWe6v523L4OA1bJO02S7MO2oyXDCS6iWb9ckIPnqAFVItqSBQr7jw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -5352,6 +5379,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@csstools/css-parser-algorithms": "^3.0.5",
|
||||
"@csstools/css-syntax-patches-for-csstree": "^1.0.19",
|
||||
"@csstools/css-tokenizer": "^3.0.4",
|
||||
"@csstools/media-query-list-parser": "^4.0.3",
|
||||
"@csstools/selector-specificity": "^5.0.0",
|
||||
@@ -5364,7 +5392,7 @@
|
||||
"debug": "^4.4.3",
|
||||
"fast-glob": "^3.3.3",
|
||||
"fastest-levenshtein": "^1.0.16",
|
||||
"file-entry-cache": "^10.1.4",
|
||||
"file-entry-cache": "^11.1.1",
|
||||
"global-modules": "^2.0.0",
|
||||
"globby": "^11.1.0",
|
||||
"globjoin": "^0.1.4",
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
"postcss": "^8.4.41",
|
||||
"prettier": "^3.3.3",
|
||||
"prettier-plugin-tailwindcss": "^0.6.5",
|
||||
"stylelint": "^16.8.0",
|
||||
"stylelint": "^16.26.1",
|
||||
"stylelint-config-standard": "^36.0.1",
|
||||
"tailwindcss": "^3.4.19"
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user