Skip to content

Commit b30ef3f

Browse files
add checks for the Network Strength
1 parent 9cf60f3 commit b30ef3f

2 files changed

Lines changed: 14 additions & 24 deletions

File tree

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ Follow this exact order for a smooth deployment.
3838

3939
1. Create a free account and a new project on [Supabase](https://supabase.com).
4040
2. Save these values from your Supabase dashboard:
41-
- **Project URL** (Project Settings → API)
42-
- **Anon key** (Project Settings → API)
43-
- **Project Reference ID** (the `<project-ref>` in `https://<project-ref>.supabase.co`)
4441
- **Database password** (the password for this Supabase project)
42+
- **Project ID (Project Ref ID)** (the `<project-ref>` in `https://<project-ref>.supabase.co`)
4543
- **Personal Access Token** ([Account Settings → Access Tokens](https://supabase.com/dashboard/account/tokens))
44+
- **Project URL** (Project Settings → API)
45+
- **Anon key** (Project Settings → API)
4646

4747
### Step 3: In your fork, add GitHub secrets and run workflow
4848

@@ -77,7 +77,8 @@ Then:
7777
3. Add the environment variables below.
7878
4. Click **Deploy**.
7979

80-
Vercel will ask for:
80+
**Environment Variables:**
81+
Set the following Vercel environment variables:
8182

8283
- `VITE_SUPABASE_PROJECT_URL`
8384
- `VITE_SUPABASE_ANON_KEY`

src/pages/Home.tsx

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -291,24 +291,13 @@ const Home: React.FC<HomeProps> = ({
291291
</div>
292292
))}
293293

294-
<div>
295-
<span className="font-medium text-muted-foreground flex items-center gap-2 mb-1">
296-
<Signal className="h-4 w-4" />
297-
Network Strength
298-
</span>
299-
{deviceStatus === "offline" ? (
300-
<span className="block pl-6 font-medium text-muted-foreground">
301-
Device Offline
294+
{signalStrength !== null && signalStrength !== undefined && deviceStatus !== "offline" && (
295+
<div>
296+
<span className="font-medium text-muted-foreground flex items-center gap-2 mb-1">
297+
<Signal className="h-4 w-4" />
298+
Network Strength
302299
</span>
303-
) : (
304-
(() => {
305-
if (
306-
signalStrength === null ||
307-
signalStrength === undefined
308-
) {
309-
return <span className="block pl-6">-</span>;
310-
}
311-
300+
{(() => {
312301
const networkTypeTag = nodeDetails.tags?.find(
313302
(tag) =>
314303
tag.key === "networkType" || tag.key === "Network Type"
@@ -370,9 +359,9 @@ const Home: React.FC<HomeProps> = ({
370359
</span>
371360
</span>
372361
);
373-
})()
374-
)}
375-
</div>
362+
})()}
363+
</div>
364+
)}
376365

377366
{gatewayError && (
378367
<div className="md:col-span-2 lg:col-span-2">

0 commit comments

Comments
 (0)