Skip to content

Commit 7807d67

Browse files
committed
v0.2.0 - Experimental Note Attachments
1 parent 0a22978 commit 7807d67

File tree

17 files changed

+787
-472
lines changed

17 files changed

+787
-472
lines changed

browser-extension/background.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,26 @@ async function encryptAndStoreNotes(notes) {
6868
cryptoService = await CryptoService.new(settings.seed_phrase);
6969
}
7070

71-
const encrypted = await cryptoService.encrypt(notes);
71+
// Filter out attachment data to save storage space in extension
72+
const notesWithoutAttachments = notes.map(note => ({
73+
id: note.id,
74+
title: note.title,
75+
content: note.content,
76+
created_at: note.created_at,
77+
updated_at: note.updated_at,
78+
deleted: note.deleted,
79+
pending_sync: note.pending_sync,
80+
// Keep minimal attachment metadata
81+
attachments: note.attachments?.map(att => ({
82+
id: att.id,
83+
name: att.name,
84+
type: att.type,
85+
size: att.size,
86+
timestamp: att.timestamp
87+
})) || []
88+
}));
89+
90+
const encrypted = await cryptoService.encrypt(notesWithoutAttachments);
7291
await chrome.storage.local.set({
7392
encrypted_notes: encrypted,
7493
lastUpdated: Date.now()

browser-extension/manifest.chrome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "Trusty Notes",
4-
"version": "0.1.6",
4+
"version": "0.2.0",
55
"description": "Quick access to your encrypted notes",
66
"externally_connectable": {
77
"matches": ["https://trustynotes.app/*"]

browser-extension/manifest.firefox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "Trusty Notes",
4-
"version": "0.1.6",
4+
"version": "0.2.0",
55
"description": "Quick access to your encrypted notes",
66
"externally_connectable": {
77
"matches": ["https://trustynotes.app/*"]

0 commit comments

Comments
 (0)