From 81ea88443eb4acd97e98f97c31ab1330a55d323f Mon Sep 17 00:00:00 2001
From: hamster1963 <1410514192@qq.com>
Date: Mon, 29 Jul 2024 18:00:28 +0800
Subject: [PATCH] perf: remove unused deps
---
app/(main)/ClientComponents/LiveTag.tsx | 43 ----------------------
app/layout.tsx | 2 -
bun.lockb | Bin 407604 -> 406873 bytes
components/client/NextToast.tsx | 27 --------------
components/client/client-side-refresh.tsx | 18 ---------
components/client/theme-switcher.tsx | 40 --------------------
package.json | 6 +--
7 files changed, 2 insertions(+), 134 deletions(-)
delete mode 100644 app/(main)/ClientComponents/LiveTag.tsx
delete mode 100644 components/client/NextToast.tsx
delete mode 100644 components/client/client-side-refresh.tsx
delete mode 100644 components/client/theme-switcher.tsx
diff --git a/app/(main)/ClientComponents/LiveTag.tsx b/app/(main)/ClientComponents/LiveTag.tsx
deleted file mode 100644
index 46cba27..0000000
--- a/app/(main)/ClientComponents/LiveTag.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-"use client";
-import { useEffect, useState } from "react";
-import { toast } from "sonner";
-
-import { Badge } from "@/components/ui/badge";
-import { verifySSEConnection } from "@/lib/sseFetch";
-
-export default function LiveTag() {
- const [connected, setConnected] = useState(false);
-
- useEffect(() => {
- // Store the promise in a variable
- const ssePromise = verifySSEConnection(
- "https://home.buycoffee.tech/v2/VerifySSEConnect",
- );
- setTimeout(() => {
- toast.promise(ssePromise, {
- loading: "Connecting to SSE...",
- success: "HomeDash SSE Connected",
- error: "Error connecting to SSE",
- });
- });
- // Handle promise resolution separately
- ssePromise
- .then(() => {
- setConnected(true);
- })
- .catch(() => {
- setConnected(false);
- });
- }, []);
-
- return connected ? (
-
- Synced
-
-
- ) : (
-
- Static
-
- );
-}
diff --git a/app/layout.tsx b/app/layout.tsx
index da61a5f..5ad011a 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -5,7 +5,6 @@ import { Inter as FontSans } from "next/font/google";
import { ThemeProvider } from "next-themes";
import React from "react";
-import NextThemeToaster from "@/components/client/NextToast";
import { cn } from "@/lib/utils";
const fontSans = FontSans({
@@ -43,7 +42,6 @@ export default function RootLayout({ children }: RootLayoutProps) {
enableSystem
disableTransitionOnChange
>
-
{children}