From af096a08a0428aa1653946b5e391679fe10735c0 Mon Sep 17 00:00:00 2001 From: nl Date: Tue, 8 Apr 2025 08:21:51 +0900 Subject: [PATCH] Gradually replace default tips with user-defined ones on long press (up to 7) (#2069) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * commented the lines to make sure dupes are also checked on subdomains * chore: fix lint issues * add more than 3 custom tips, up to 7 total * fix merge issue * shorten logic * don't check length for slice without need --------- Co-authored-by: 김현희 Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com> Co-authored-by: k00b --- components/item-act.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/item-act.js b/components/item-act.js index 769d68f8..0e049c13 100644 --- a/components/item-act.js +++ b/components/item-act.js @@ -18,7 +18,10 @@ import { useSendWallets } from '@/wallets/index' const defaultTips = [100, 1000, 10_000, 100_000] const Tips = ({ setOValue }) => { - const tips = [...getCustomTips(), ...defaultTips].sort((a, b) => a - b) + const customTips = getCustomTips() + const defaultNoCustom = defaultTips.filter(d => !customTips.includes(d)) + const tips = [...customTips, ...defaultNoCustom].slice(0, 7).sort((a, b) => a - b) + return tips.map((num, i) =>