Skip to content

Commit

Permalink
Better deny all nwc
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman authored and futurepaul committed Oct 23, 2023
1 parent b772386 commit 94856d5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 26 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.mutinywallet.mutinywallet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 21
versionName "0.4.23"
versionCode 22
versionName "0.4.24"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mutiny-wallet",
"version": "0.4.23",
"version": "0.4.24",
"license": "MIT",
"packageManager": "[email protected]",
"scripts": {
Expand Down Expand Up @@ -55,7 +55,7 @@
"@kobalte/tailwindcss": "^0.5.0",
"@modular-forms/solid": "^0.18.1",
"@mutinywallet/barcode-scanner": "5.0.0-beta.3",
"@mutinywallet/mutiny-wasm": "0.4.23",
"@mutinywallet/mutiny-wasm": "0.4.24",
"@mutinywallet/waila-wasm": "^0.2.1",
"@nostr-dev-kit/ndk": "^0.8.11",
"@solid-primitives/upload": "^0.0.111",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 7 additions & 17 deletions src/components/PendingNwc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,6 @@ export function PendingNwc() {
}
}

async function denyItem(item: PendingItem) {
try {
setPaying(item.id);
await state.mutiny_wallet?.deny_invoice(item.id);
} catch (e) {
setError(eify(e));
console.error(e);
} finally {
setPaying("");
refetch();
}
}

async function approveAll() {
// clone the list so it doesn't update in place
const toApprove = [...pendingRequests()!];
Expand All @@ -109,10 +96,13 @@ export function PendingNwc() {
}

async function denyAll() {
// clone the list so it doesn't update in place
const toDeny = [...pendingRequests()!];
for (const item of toDeny) {
await denyItem(item);
try {
await state.mutiny_wallet?.deny_all_pending_nwc();
} catch (e) {
setError(eify(e));
console.error(e);
} finally {
refetch();
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/routes/settings/Plus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ function PlusCTA() {
throw new Error(i18n.t("settings.plus.error_failure"));

await state.mutiny_wallet?.pay_subscription_invoice(
invoice?.bolt11
invoice?.bolt11,
false // todo add flag for auto-pay
);

await vibrateSuccess();
Expand Down

0 comments on commit 94856d5

Please sign in to comment.