mirror of
https://github.com/aclist/dztui.git
synced 2026-08-26 17:57:06 +02:00
fix: notes file may not be present
This commit is contained in:
parent
d3f64c1ba5
commit
676a7ea9eb
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user