Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show warning when force_reload is used on data sources #3895

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions nicegui/elements/interactive_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from .. import optional_features
from ..events import GenericEventArguments, Handler, MouseEventArguments, handle_event
from ..logging import log
from .image import pil_to_base64
from .mixins.content_element import ContentElement
from .mixins.source_element import SourceElement
Expand Down Expand Up @@ -95,5 +96,8 @@ def _set_props(self, source: Union[str, Path, 'PIL_Image']) -> None: # noqa: UP

def force_reload(self) -> None:
"""Force the image to reload from the source."""
if self.source.startswith('data:'):
log.warning('interactive_image: force_reload() only works with network sources (not base64)')
return
self._props['t'] = time.time()
self.update()
Loading