@danhachuel/thunderbolt 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/main.py +7 -1
- package/package.json +1 -1
package/app/main.py
CHANGED
|
@@ -7135,6 +7135,7 @@ def _render_media_provider_card(settings: dict[str, Any], cards: list[dict[str,
|
|
|
7135
7135
|
with card_form:
|
|
7136
7136
|
key_col, model_col = st.columns(2)
|
|
7137
7137
|
refresh_clicked = False
|
|
7138
|
+
authorize_clicked = False
|
|
7138
7139
|
with key_col:
|
|
7139
7140
|
api_key = str(card.get("api_key") or "")
|
|
7140
7141
|
if definition.requires_api_key:
|
|
@@ -7231,7 +7232,12 @@ def _render_media_provider_card(settings: dict[str, Any], cards: list[dict[str,
|
|
|
7231
7232
|
edited = dict(card)
|
|
7232
7233
|
edited.update({"api_key": str(api_key or "").strip(), "model": str(model or "").strip(), "base_url": str(base_url or "").strip(), "enabled": bool(enabled), "supports_image": bool(supports_image), "supports_video": bool(supports_video), "priority": int(priority), **extra_values})
|
|
7233
7234
|
cards[index] = edited
|
|
7234
|
-
if
|
|
7235
|
+
if authorize_clicked:
|
|
7236
|
+
# Guardar as credenciais antes de o browser sair para a Canva. No
|
|
7237
|
+
# callback, o código OAuth é trocado usando este card persistido.
|
|
7238
|
+
_persist_media_cards(settings, cards, str(settings.get(MEDIA_IMAGE_ACTIVE_CARD_KEY) or ""), str(settings.get(MEDIA_VIDEO_ACTIVE_CARD_KEY) or ""))
|
|
7239
|
+
st.success("Credenciais Canva guardadas. Abra o link para autorizar.")
|
|
7240
|
+
elif refresh_clicked:
|
|
7235
7241
|
try:
|
|
7236
7242
|
discovered = _fetch_media_models(edited)
|
|
7237
7243
|
st.session_state[f"media_model_catalog_{card_id}"] = discovered
|
package/package.json
CHANGED