mirror of
https://github.com/aclist/dztui.git
synced 2026-10-25 12:12:31 +01:00
fix: notes file may not be present
This commit is contained in:
1 parent
d3f64c1ba5
commit
676a7ea9eb
1 file changed
+4
-1
@@ -20,7 +20,10 @@ logger = logging.getLogger(APP_NAME)
|
||||
class NoteManager:
|
||||
def __init__(self, controller: "Controller", path: "Path") -> None:
|
||||
self.notes_path = path
|
||||
self.cache: dict[str, str] = read_json(self.notes_path)
|
||||
try:
|
||||
self.cache: dict[str, str] = read_json(self.notes_path)
|
||||
except Exception:
|
||||
self.cache = {}
|
||||
|
||||
def add_note(self, server: str, note: str) -> None:
|
||||
self.cache[server] = note
|
||||
|
||||
Reference in new issue
Block a user