From acf042f06e35c2fd0a696ea02ab0e3fd7b8b5d94 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Thu, 19 Jun 2025 19:36:20 +0200 Subject: [PATCH] Remove directReceive setting (#2230) * Remove directReceive setting * Keep directReceive in typedef for backward compatibility --- api/paidAction/receive.js | 1 - api/typeDefs/user.js | 3 +-- fragments/users.js | 2 -- pages/settings/index.js | 17 ----------------- .../migration.sql | 8 ++++++++ prisma/schema.prisma | 1 - 6 files changed, 9 insertions(+), 23 deletions(-) create mode 100644 prisma/migrations/20250614190749_remove_direct_receive_setting/migration.sql diff --git a/api/paidAction/receive.js b/api/paidAction/receive.js index cd31df0e..d665cac0 100644 --- a/api/paidAction/receive.js +++ b/api/paidAction/receive.js @@ -16,7 +16,6 @@ export async function getCost ({ msats }) { export async function getInvoiceablePeer (_, { me, models, cost, paymentMethod }) { if (paymentMethod === PAID_ACTION_PAYMENT_METHODS.P2P && !me?.proxyReceive) return null - if (paymentMethod === PAID_ACTION_PAYMENT_METHODS.DIRECT && !me?.directReceive) return null const wallets = await getInvoiceableWallets(me.id, { models }) if (wallets.length === 0) { diff --git a/api/typeDefs/user.js b/api/typeDefs/user.js index 9420150d..03fe5551 100644 --- a/api/typeDefs/user.js +++ b/api/typeDefs/user.js @@ -125,7 +125,6 @@ export default gql` wildWestMode: Boolean! withdrawMaxFeeDefault: Int! proxyReceive: Boolean - directReceive: Boolean receiveCreditsBelowSats: Int! sendCreditsBelowSats: Int! } @@ -209,7 +208,7 @@ export default gql` vaultKeyHash: String walletsUpdatedAt: Date proxyReceive: Boolean - directReceive: Boolean + directReceive: Boolean @deprecated receiveCreditsBelowSats: Int! sendCreditsBelowSats: Int! } diff --git a/fragments/users.js b/fragments/users.js index c2df7f81..ba3734eb 100644 --- a/fragments/users.js +++ b/fragments/users.js @@ -54,7 +54,6 @@ ${STREAK_FIELDS} vaultKeyHash walletsUpdatedAt proxyReceive - directReceive } optional { isContributor @@ -117,7 +116,6 @@ export const SETTINGS_FIELDS = gql` } apiKeyEnabled proxyReceive - directReceive receiveCreditsBelowSats sendCreditsBelowSats } diff --git a/pages/settings/index.js b/pages/settings/index.js index 9fb98bf3..f911f3d8 100644 --- a/pages/settings/index.js +++ b/pages/settings/index.js @@ -160,7 +160,6 @@ export default function Settings ({ ssrData }) { hideIsContributor: settings?.hideIsContributor, noReferralLinks: settings?.noReferralLinks, proxyReceive: settings?.proxyReceive, - directReceive: settings?.directReceive, receiveCreditsBelowSats: settings?.receiveCreditsBelowSats, sendCreditsBelowSats: settings?.sendCreditsBelowSats }} @@ -367,22 +366,6 @@ export default function Settings ({ ssrData }) { name='proxyReceive' groupClassName='mb-0' /> - directly deposit to attached wallets - -
    -
  • Directly deposit to your attached wallets if they cause your balance to exceed your auto-withdraw threshold
  • -
  • Senders will be able to see your wallet's lightning node public key
  • -
  • If 'proxy deposits' is also checked, it will take precedence and direct deposits will only be used as a fallback
  • -
  • Because we can't determine if a payment succeeds, you won't be notified about direct deposits
  • -
-
- - } - name='directReceive' - groupClassName='mb-0' - /> hide invoice descriptions diff --git a/prisma/migrations/20250614190749_remove_direct_receive_setting/migration.sql b/prisma/migrations/20250614190749_remove_direct_receive_setting/migration.sql new file mode 100644 index 00000000..48c189e4 --- /dev/null +++ b/prisma/migrations/20250614190749_remove_direct_receive_setting/migration.sql @@ -0,0 +1,8 @@ +/* + Warnings: + + - You are about to drop the column `directReceive` on the `users` table. All the data in the column will be lost. + +*/ +-- AlterTable +ALTER TABLE "users" DROP COLUMN "directReceive"; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index cb92eab8..a1be3ede 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -148,7 +148,6 @@ model User { walletsUpdatedAt DateTime? vaultEntries VaultEntry[] @relation("VaultEntries") proxyReceive Boolean @default(true) - directReceive Boolean @default(true) DirectPaymentReceived DirectPayment[] @relation("DirectPaymentReceived") DirectPaymentSent DirectPayment[] @relation("DirectPaymentSent") UserSubTrust UserSubTrust[]