diff --git a/src-react/README.md b/src-react/README.md index 102e366..3537133 100644 --- a/src-react/README.md +++ b/src-react/README.md @@ -5,3 +5,39 @@ This template should help get you started developing with Tauri, React and Types ## Recommended IDE Setup - [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) + +## Mobile development + +### Windows Firewall + +On Windows, the firewall cound be an issue. Try this: + +**Quick test first — temporarily disable firewall** +If your phone can connect after disabling it, the firewall is confirmed as the cause. + +**Proper fix — add a firewall rule (run PowerShell as Admin):** +```powershell +New-NetFirewallRule -DisplayName "Dev Server 1420" -Direction Inbound -Protocol TCP -LocalPort 1420 -Action Allow +``` + +**Or via GUI:** +1. Search → "Windows Defender Firewall with Advanced Security" +2. Inbound Rules → New Rule +3. Port → TCP → 1420 → Allow → All profiles → Save + +**Also check if Windows marked your network as Public** (Public networks block most inbound connections): + +```powershell +# Check current network profile +Get-NetConnectionProfile +``` +If `NetworkCategory` shows `Public`, change it to `Private`: +```powershell +Set-NetConnectionProfile -Name "YOUR_NETWORK_NAME" -NetworkCategory Private +``` + +**Verify the port is actually listening on 0.0.0.0:** +```powershell +netstat -an | findstr 1420 +``` +You want to see `0.0.0.0:1420` — if it shows `127.0.0.1:1420` the server binding is still the problem. diff --git a/src-react/src/pages/SearchPage.tsx b/src-react/src/pages/SearchPage.tsx index 0069a31..b59dca1 100644 --- a/src-react/src/pages/SearchPage.tsx +++ b/src-react/src/pages/SearchPage.tsx @@ -114,6 +114,8 @@ function SearchPage() { } else { setEntries([...entries, ...result]); } + + return result; } const onEntriesScrollEnd: UIEventHandler = async ({ target }) => { @@ -123,7 +125,11 @@ function SearchPage() { if (scrollHeight - 20 > scrollTop + target.getBoundingClientRect().height) return; - await runSearch(false); + const results = await runSearch(false); + if (!results?.length) { + target.style.paddingBottom = "50vh"; + return; + } setTimeout(() => { target.scrollTop = scrollTop + 100;