memos icon indicating copy to clipboard operation
memos copied to clipboard

Fail to restore unsaved memo resource list

Open nethbotheju opened this issue 7 months ago • 1 comments

Describe the bug

When adding a new memo with unsaved content and a resource attached:

  • If you do not save the memo and then refresh the page or navigate away and return, the memo text is restored correctly.

  • However, the attached resource is not restored.

  • The resource does appear on the Resources page under "Unsaved Resources", indicating it was uploaded.

  • The issue is that the memo loses its link to the resource upon refresh, even though the resource itself still exists.

Same thing happens when you try to edit an existing memo but do not save or cancel, then refresh the page and edit the same memo again the unsaved content is restored, but the resource list is not.

Steps to reproduce

  1. Add new memo and attach a resource
  2. Do not save the memo
  3. Refresh the page

The version of Memos you're using

v0.24.3

Screenshots or additional context

https://github.com/user-attachments/assets/4649446c-eb88-4468-872a-6009e69a41d0

nethbotheju avatar May 22 '25 17:05 nethbotheju

Can we just switch to using useLocalStorage() instead of useState() for storing State object?? This wil fix the issue.

gopnik5 avatar Jun 10 '25 19:06 gopnik5