From 9c6077e54e41dc712317db4deba9557b6d119076 Mon Sep 17 00:00:00 2001 From: Rigidity Date: Fri, 7 Mar 2025 15:23:33 -0500 Subject: [PATCH 1/3] fmt and lint --- crates/sage-database/src/blockinfo.rs | 2 +- crates/sage-database/src/coin_states.rs | 8 ++++---- crates/sage-database/src/primitives/nfts.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/sage-database/src/blockinfo.rs b/crates/sage-database/src/blockinfo.rs index 3c81929a..90be49b8 100644 --- a/crates/sage-database/src/blockinfo.rs +++ b/crates/sage-database/src/blockinfo.rs @@ -29,7 +29,7 @@ impl Database { } } -impl<'a> DatabaseTx<'a> { +impl DatabaseTx<'_> { pub async fn find_created_timestamp_null(&mut self, limit: u32) -> Result> { find_created_timestamp_null(&mut *self.tx, limit).await } diff --git a/crates/sage-database/src/coin_states.rs b/crates/sage-database/src/coin_states.rs index 67a952d5..91a76422 100644 --- a/crates/sage-database/src/coin_states.rs +++ b/crates/sage-database/src/coin_states.rs @@ -489,13 +489,13 @@ async fn get_block_heights( query .push("ticker LIKE ") - .push_bind(format!("%{}%", value)) + .push_bind(format!("%{value}%")) .push(" OR cat_name LIKE ") - .push_bind(format!("%{}%", value)) + .push_bind(format!("%{value}%")) .push(" OR did_name LIKE ") - .push_bind(format!("%{}%", value)) + .push_bind(format!("%{value}%")) .push(" OR nft_name LIKE ") - .push_bind(format!("%{}%", value)) + .push_bind(format!("%{value}%")) .push(")"); } diff --git a/crates/sage-database/src/primitives/nfts.rs b/crates/sage-database/src/primitives/nfts.rs index 161c4d8a..c207ea73 100644 --- a/crates/sage-database/src/primitives/nfts.rs +++ b/crates/sage-database/src/primitives/nfts.rs @@ -897,7 +897,7 @@ async fn search_nfts( // Add name search if present if let Some(name_search) = ¶ms.name { query.push(" AND name LIKE "); - query.push_bind(format!("%{}%", name_search)); + query.push_bind(format!("%{name_search}%")); } // Add ORDER BY clause based on sort_mode From 30ca207fbdc2ab1a1ebef097394fe457ad31a624 Mon Sep 17 00:00:00 2001 From: Rigidity Date: Fri, 7 Mar 2025 15:33:26 -0500 Subject: [PATCH 2/3] Improve login screen styling --- src/pages/Login.tsx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index 4473ec6d..4c45bd0b 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -23,7 +23,9 @@ import { Switch } from '@/components/ui/switch'; import { useErrors } from '@/hooks/useErrors'; import { t } from '@lingui/core/macro'; import { Trans } from '@lingui/react/macro'; +import { platform } from '@tauri-apps/plugin-os'; import { + CogIcon, EraserIcon, EyeIcon, FlameIcon, @@ -32,15 +34,13 @@ import { PenIcon, SnowflakeIcon, TrashIcon, - CogIcon, } from 'lucide-react'; import { useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { commands, KeyInfo, SecretKeyInfo } from '../bindings'; import Container from '../components/Container'; -import { loginAndUpdateState } from '../state'; -import { platform } from '@tauri-apps/plugin-os'; import { useWallet } from '../contexts/WalletContext'; +import { loginAndUpdateState } from '../state'; const isMobile = platform() === 'ios' || platform() === 'android'; @@ -74,7 +74,7 @@ export default function Login() {
@@ -103,7 +103,7 @@ export default function Login() {
{keys !== null ? ( keys.length ? ( -
+
{keys.map((key, i) => ( +
{Array.from({ length: 3 }).map((_, i) => (
@@ -309,20 +309,20 @@ function WalletItem({ network, info, keys, setKeys }: WalletItemProps) { -
+
{info.fingerprint} {info.has_secrets ? ( -
- +
+ - Hot Wallet + Hot
) : ( -
- +
+ - Cold Wallet + Cold
)} From a591e00e0f34ab27a41cae1bdfd9eedc547f78bb Mon Sep 17 00:00:00 2001 From: Rigidity Date: Fri, 7 Mar 2025 15:44:26 -0500 Subject: [PATCH 3/3] improve --- src/pages/Login.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index 4c45bd0b..42598252 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -103,7 +103,7 @@ export default function Login() {
{keys !== null ? ( keys.length ? ( -
+
{keys.map((key, i) => ( +
{Array.from({ length: 3 }).map((_, i) => (
@@ -234,7 +234,7 @@ function WalletItem({ network, info, keys, setKeys }: WalletItemProps) { return ( <> loginSelf(false)} className='cursor-pointer'> - + {info.name} @@ -308,18 +308,18 @@ function WalletItem({ network, info, keys, setKeys }: WalletItemProps) { - +
{info.fingerprint} {info.has_secrets ? ( -
+
Hot
) : ( -
+
Cold