Mercurial > libervia-web
comparison libervia/web/pages/_browser/cache.py @ 1619:a2cd4222c702
browser: Updates for new design:
This patch add code to handle the new design for chat.
New bridge method are used to invite users to MUC or get list of occupants.
A new modules is used for components, with a first one for collapsible cards.
rel 457
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 12 Apr 2025 00:21:45 +0200 |
parents | 9b451115e726 |
children |
comparison
equal
deleted
inserted
replaced
1618:5d9889f14012 | 1619:a2cd4222c702 |
---|---|
1 from browser import window, console as log | 1 from browser import window, console as log |
2 from browser.local_storage import storage | 2 from browser.local_storage import storage |
3 from dialog import notification | 3 from dialog import notification |
4 from bridge import Bridge, AsyncBridge | 4 from bridge import Bridge, AsyncBridge |
5 import javascript | |
5 import json | 6 import json |
6 | 7 |
7 log.warning = log.warn | 8 log.warning = log.warn |
8 session_uuid = window.session_uuid | 9 session_uuid = window.session_uuid |
9 bridge = Bridge() | 10 bridge = Bridge() |
40 def identities(self): | 41 def identities(self): |
41 return self._cache['identities'] | 42 return self._cache['identities'] |
42 | 43 |
43 def update(self): | 44 def update(self): |
44 log.debug(f"updating: {self._cache}") | 45 log.debug(f"updating: {self._cache}") |
45 storage['libervia_cache'] = json.dumps(self._cache) | 46 # FIXME: workaround in Brython 3.13.0 |
47 # storage['libervia_cache'] = json.dumps(self._cache) | |
48 storage['libervia_cache'] = javascript.JSON.stringify(self._cache) | |
46 log.debug("cache stored") | 49 log.debug("cache stored") |
47 | 50 |
48 def _store_if_complete(self): | 51 def _store_if_complete(self): |
49 self._completed_count -= 1 | 52 self._completed_count -= 1 |
50 if self._completed_count == 0: | 53 if self._completed_count == 0: |