{emails.map((email) => (
-
@@ -167,7 +169,7 @@ const EmailsList: React.FC = () => {
{email.messagePreview}
-
+
))}
diff --git a/browser-extensions/chrome/src/pages/Home.tsx b/browser-extensions/chrome/src/pages/Home.tsx
index 0713fe666..41fb2b8ca 100644
--- a/browser-extensions/chrome/src/pages/Home.tsx
+++ b/browser-extensions/chrome/src/pages/Home.tsx
@@ -12,7 +12,7 @@ const Home: React.FC = () => {
const dbContext = useDb();
const navigate = useNavigate();
const [isInlineUnlockMode, setIsInlineUnlockMode] = useState(false);
- const needsUnlock = !authContext.isLoggedIn || !authContext.isInitialized || !dbContext.dbAvailable || !dbContext.dbInitialized;
+ const needsUnlock = (!authContext.isLoggedIn && authContext.isInitialized) || (!dbContext.dbAvailable && dbContext.dbInitialized);
useEffect(() => {
if (isLoggedIn && !needsUnlock && !isInlineUnlockMode) {
@@ -23,12 +23,10 @@ const Home: React.FC = () => {
if (!isLoggedIn) {
- console.log('not logged in');
return
;
}
if (needsUnlock) {
- console.log('needs unlock');
return
;
}
diff --git a/browser-extensions/chrome/src/pages/Login.tsx b/browser-extensions/chrome/src/pages/Login.tsx
index f0ee25a3d..57d22af0d 100644
--- a/browser-extensions/chrome/src/pages/Login.tsx
+++ b/browser-extensions/chrome/src/pages/Login.tsx
@@ -20,7 +20,7 @@ const Login: React.FC = () => {
password: '',
});
const { showLoading, hideLoading } = useLoading();
- const [rememberMe, setRememberMe] = useState(false);
+ const [rememberMe, setRememberMe] = useState(true);
const [error, setError] = useState
(null);
const webApi = useWebApi();
const srpUtil = new SrpUtility(webApi);
diff --git a/browser-extensions/chrome/src/types/webapi/Attachment.ts b/browser-extensions/chrome/src/types/webapi/Attachment.ts
new file mode 100644
index 000000000..7d3736aa6
--- /dev/null
+++ b/browser-extensions/chrome/src/types/webapi/Attachment.ts
@@ -0,0 +1,7 @@
+export type Attachment = {
+ id: number;
+ emailId: number;
+ filename: string;
+ mimeType: string;
+ filesize: number;
+}
\ No newline at end of file
diff --git a/browser-extensions/chrome/src/types/webapi/Email.ts b/browser-extensions/chrome/src/types/webapi/Email.ts
new file mode 100644
index 000000000..f88518999
--- /dev/null
+++ b/browser-extensions/chrome/src/types/webapi/Email.ts
@@ -0,0 +1,51 @@
+import { Attachment } from "./Attachment";
+
+export type Email = {
+ /** The body of the email message */
+ messageHtml: string;
+
+ /** The plain text body of the email message */
+ messagePlain: string;
+
+ /** The ID of the email */
+ id: number;
+
+ /** The subject of the email */
+ subject: string;
+
+ /** The display name of the sender */
+ fromDisplay: string;
+
+ /** The domain of the sender's email address */
+ fromDomain: string;
+
+ /** The local part of the sender's email address */
+ fromLocal: string;
+
+ /** The domain of the recipient's email address */
+ toDomain: string;
+
+ /** The local part of the recipient's email address */
+ toLocal: string;
+
+ /** The date of the email */
+ date: string;
+
+ /** The system date of the email */
+ dateSystem: string;
+
+ /** The number of seconds ago the email was received */
+ secondsAgo: number;
+
+ /**
+ * The encrypted symmetric key which was used to encrypt the email message.
+ * This key is encrypted with the public key of the user.
+ */
+ encryptedSymmetricKey: string;
+
+ /** The public key of the user used to encrypt the symmetric key */
+ encryptionKey: string;
+
+ /** The attachments of the email */
+ attachments: Attachment[];
+}
diff --git a/browser-extensions/chrome/src/utils/WebApiService.ts b/browser-extensions/chrome/src/utils/WebApiService.ts
index 79c9e78ff..677c59f74 100644
--- a/browser-extensions/chrome/src/utils/WebApiService.ts
+++ b/browser-extensions/chrome/src/utils/WebApiService.ts
@@ -173,7 +173,7 @@ export class WebApiService {
* Issue DELETE request to the API.
*/
public async delete(endpoint: string): Promise {
- return this.fetch(endpoint, { method: 'DELETE' });
+ return this.fetch(endpoint, { method: 'DELETE' }, false);
}
/**