Désiré Werner Menrath f5156e70c3 fix(encryption): Prevent double encryption on save
This commit fixes a critical bug where saving an already encrypted item would lead to double encryption, making the data unrecoverable.

The `save` methods in the ViewModels (`RecipesViewModel`, `NotesViewModel`, `ShoppingListsViewModel`) were encrypting content if the `isLocked` flag was true, without checking if the content was already encrypted. This happened when saving on navigating back from the detail screen.

The fix introduces an `isDecrypted` flag in the `...Details` data classes.
- This flag is set to `true` only when content is explicitly decrypted for viewing or editing.
- The `save` methods now only perform encryption if `isLocked` is true AND `isDecrypted` is true.
- This ensures that already encrypted data is never re-encrypted.
2025-10-19 00:59:21 +02:00
Description
Noteshop is a versatile and privacy-focused application for managing your notes, shopping lists, and recipes all in one place. It is designed to be simple, efficient, and fully under your control
2.4 MiB
Languages
Kotlin 98%
Python 2%