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

Use an equality check instead of startswith #4024

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
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: 3 additions & 1 deletion reflex/components/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from reflex import constants
from reflex.utils import imports
from reflex.utils.format import format_library_name
from reflex.utils.serializers import serializer
from reflex.vars import Var, get_unique_variable_name
from reflex.vars.base import VarData, transform
Expand Down Expand Up @@ -64,11 +65,12 @@ def make_component(component: Component) -> str:

imports = {}
for lib, names in component._get_all_imports().items():
formatted_lib_name = format_library_name(lib)
if (
not lib.startswith((".", "/"))
and not lib.startswith("http")
and all(
not lib.startswith(lib_in_window)
formatted_lib_name != lib_in_window
for lib_in_window in libs_in_window
)
):
Expand Down
Loading