0 ? email.from[0] : ''}>
@@ -91,7 +93,9 @@ export default function EmailTableRow(props: EmailTableRowProps) {
backgroundClassName +
unreadClassName
}
- onClick={openEmail}
+ onClick={() => {
+ void openEmail()
+ }}
>
{email.subject}
@@ -101,7 +105,9 @@ export default function EmailTableRow(props: EmailTableRowProps) {
backgroundClassName +
(email.unread ? ' md:font-bold' : ' md:dark:font-light')
}
- onClick={openEmail}
+ onClick={() => {
+ void openEmail()
+ }}
>
{formatDate(
email.timeReceived ?? email.timeUpdated ?? email.timeSent ?? '',
diff --git a/web/src/pages/EmailRawView.tsx b/web/src/pages/EmailRawView.tsx
index a8d6e4e83f..ca535bf3b1 100644
--- a/web/src/pages/EmailRawView.tsx
+++ b/web/src/pages/EmailRawView.tsx
@@ -1,5 +1,5 @@
import React from 'react'
-import { Await, useLoaderData } from 'react-router-dom'
+import { Await, useLoaderData } from 'react-router'
import { Toaster } from '@ui/toaster'
import { toast } from '@ui/use-toast'
@@ -7,7 +7,7 @@ import { toast } from '@ui/use-toast'
import { reparseEmail } from 'services/emails'
export default function EmailRawView() {
- const data = useLoaderData() as { messageID: string; raw: string }
+ const data: { messageID: string; raw: string } = useLoaderData()
const [isRequesting, setIsRequesting] = React.useState(false)
diff --git a/web/src/pages/EmailRoot.tsx b/web/src/pages/EmailRoot.tsx
index 6d45141d33..8937b895d9 100644
--- a/web/src/pages/EmailRoot.tsx
+++ b/web/src/pages/EmailRoot.tsx
@@ -3,7 +3,7 @@
* This is the root component for inbox, draft, and sent pages.
*/
import { useContext, useEffect, useState } from 'react'
-import { Outlet, useOutletContext } from 'react-router-dom'
+import { Outlet, useOutletContext } from 'react-router'
import DraftEmailsTabs from 'components/emails/DraftEmailsTabs'
import FullScreenContent from 'components/emails/FullScreenContent'
diff --git a/web/src/pages/EmailView.tsx b/web/src/pages/EmailView.tsx
index 1f539250d9..78dce4625e 100644
--- a/web/src/pages/EmailView.tsx
+++ b/web/src/pages/EmailView.tsx
@@ -6,7 +6,7 @@ import {
} from '@heroicons/react/24/outline'
import React, { useContext, useEffect, useRef, useState } from 'react'
import { ErrorBoundary } from 'react-error-boundary'
-import { Await, useLoaderData, useNavigate } from 'react-router-dom'
+import { Await, useLoaderData, useNavigate } from 'react-router'
import { toast } from '@ui/use-toast'
@@ -37,9 +37,9 @@ import { parseEmailContent, parseEmailName } from 'utils/emails'
import { formatDate } from 'utils/time'
export default function EmailView() {
- const data = useLoaderData() as
+ const data:
| { type: 'email'; messageID: string; email: Email }
- | { type: 'thread'; threadID: string; thread: Thread }
+ | { type: 'thread'; threadID: string; thread: Thread } = useLoaderData()
const navigate = useNavigate()
@@ -154,7 +154,7 @@ export default function EmailView() {
} else {
await trashEmail(data.messageID)
}
- navigate(-1)
+ await navigate(-1)
}
const handleRead = async () => {
@@ -189,13 +189,17 @@ export default function EmailView() {
}
}
+ const handleBack = async () => {
+ await navigate(-1)
+ }
+
return (
<>
{
- navigate(-1)
+ void handleBack()
}}
showOperations={true}
handleDelete={() => {
diff --git a/web/src/pages/Root.tsx b/web/src/pages/Root.tsx
index 837417681d..6a63c8069b 100644
--- a/web/src/pages/Root.tsx
+++ b/web/src/pages/Root.tsx
@@ -1,6 +1,6 @@
import { Bars3Icon } from '@heroicons/react/24/outline'
import { useReducer, useRef, useState } from 'react'
-import { Outlet } from 'react-router-dom'
+import { Outlet } from 'react-router'
import { Toaster } from '@ui/toaster'