From 7f856b4dedb3fb15fc4a16873b88dc1860276954 Mon Sep 17 00:00:00 2001 From: Falko Schindler Date: Tue, 9 Apr 2024 17:54:21 +0200 Subject: [PATCH] renaming --- nicegui/client.py | 2 +- nicegui/storage.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nicegui/client.py b/nicegui/client.py index c7e31f3c3..06c6bf686 100644 --- a/nicegui/client.py +++ b/nicegui/client.py @@ -74,7 +74,7 @@ def __init__(self, page: page, *, shared: bool = False) -> None: self._body_html = '' self.page = page - self.state = ObservableDict() + self.storage = ObservableDict() self.connect_handlers: List[Union[Callable[..., Any], Awaitable]] = [] self.disconnect_handlers: List[Union[Callable[..., Any], Awaitable]] = [] diff --git a/nicegui/storage.py b/nicegui/storage.py index e6af8617e..1cbdecfe8 100644 --- a/nicegui/storage.py +++ b/nicegui/storage.py @@ -167,7 +167,7 @@ def client(self) -> ObservableDict: if self._is_in_auto_index_context(): raise RuntimeError('app.storage.client can only be used with page builder functions ' '(https://nicegui.io/documentation/page)') - return context.get_client().state + return context.get_client().storage @property def tab(self) -> observables.ObservableDict: @@ -201,7 +201,7 @@ def clear(self) -> None: except RuntimeError: pass # no client, could be a pytest else: - client.state.clear() + client.storage.clear() self._tabs.clear() for filepath in self.path.glob('storage-*.json'): filepath.unlink()