mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
update event
This commit is contained in:
1 parent
9e80e0c79d
commit
681fa8e76e
1 file changed
+9
+9
@@ -24,6 +24,7 @@ use openai_sora_client::creds::sora_credential_set::SoraCredentialSet;
|
||||
use openai_sora_client::recipes::maybe_upgrade_or_renew_session::maybe_upgrade_or_renew_session;
|
||||
use openai_sora_client::utils::has_session_cookie::{has_session_cookie, SessionCookiePresence};
|
||||
use tauri::{AppHandle, Manager, WebviewWindow};
|
||||
use crate::core::events::functional_events::credits_balance_changed_event::CreditsBalanceChangedEvent;
|
||||
|
||||
pub async fn storyteller_billing_window_thread(
|
||||
app: AppHandle,
|
||||
@@ -53,6 +54,14 @@ pub async fn storyteller_billing_window_thread(
|
||||
if let Err(err) = billing_webview_window.close() {
|
||||
error!("Error closing billing window: {:?}", err);
|
||||
}
|
||||
|
||||
// Refresh the credits view
|
||||
CreditsBalanceChangedEvent{}.send_infallible(&app);
|
||||
|
||||
// And in case there's a race condition (likely), do it again after a delay.
|
||||
tokio::time::sleep(std::time::Duration::from_millis(5_000)).await;
|
||||
CreditsBalanceChangedEvent{}.send_infallible(&app);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user