Skip to content

Commit

Permalink
v0.2.0 - Experimental Note Attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
0xGingi committed Dec 29, 2024
1 parent 0a22978 commit 7807d67
Show file tree
Hide file tree
Showing 17 changed files with 787 additions and 472 deletions.
21 changes: 20 additions & 1 deletion browser-extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,26 @@ async function encryptAndStoreNotes(notes) {
cryptoService = await CryptoService.new(settings.seed_phrase);
}

const encrypted = await cryptoService.encrypt(notes);
// Filter out attachment data to save storage space in extension
const notesWithoutAttachments = notes.map(note => ({
id: note.id,
title: note.title,
content: note.content,
created_at: note.created_at,
updated_at: note.updated_at,
deleted: note.deleted,
pending_sync: note.pending_sync,
// Keep minimal attachment metadata
attachments: note.attachments?.map(att => ({
id: att.id,
name: att.name,
type: att.type,
size: att.size,
timestamp: att.timestamp
})) || []
}));

const encrypted = await cryptoService.encrypt(notesWithoutAttachments);
await chrome.storage.local.set({
encrypted_notes: encrypted,
lastUpdated: Date.now()
Expand Down
2 changes: 1 addition & 1 deletion browser-extension/manifest.chrome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Trusty Notes",
"version": "0.1.6",
"version": "0.2.0",
"description": "Quick access to your encrypted notes",
"externally_connectable": {
"matches": ["https://trustynotes.app/*"]
Expand Down
2 changes: 1 addition & 1 deletion browser-extension/manifest.firefox.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Trusty Notes",
"version": "0.1.6",
"version": "0.2.0",
"description": "Quick access to your encrypted notes",
"externally_connectable": {
"matches": ["https://trustynotes.app/*"]
Expand Down
Loading

0 comments on commit 7807d67

Please sign in to comment.