From 5b19756c0547805fc328e4b09575be8d35f48249 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Tue, 5 Mar 2024 18:48:52 +0000
Subject: fix: Fix error log in extension's SavePage component

---
 packages/browser-extension/src/SavePage.tsx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'packages/browser-extension/src/SavePage.tsx')

diff --git a/packages/browser-extension/src/SavePage.tsx b/packages/browser-extension/src/SavePage.tsx
index 8d9266a1..638af149 100644
--- a/packages/browser-extension/src/SavePage.tsx
+++ b/packages/browser-extension/src/SavePage.tsx
@@ -1,10 +1,9 @@
 import { useEffect, useState } from "react";
 import Spinner from "./Spinner";
 import { api } from "./utils/trpc";
-import { useNavigate } from "react-router-dom";
+import { Navigate } from "react-router-dom";
 
 export default function SavePage() {
-  const navigator = useNavigate();
   const [error, setError] = useState<string | undefined>(undefined);
 
   const {
@@ -44,8 +43,7 @@ export default function SavePage() {
       return <div className="text-red-500">{error}</div>;
     }
     case "success": {
-      navigator(`/bookmark/${data.id}`);
-      break;
+      return <Navigate to={`/bookmark/${data.id}`} />;
     }
     case "pending": {
       return (
-- 
cgit v1.2.3-70-g09d2

