From 6049a37d50ad20500c8de3e8b00d9fe6c1ee0922 Mon Sep 17 00:00:00 2001 From: David Kocik Date: Wed, 31 Jul 2024 13:14:38 +0200 Subject: [PATCH] Do not show logged in notification on token refresh. --- src/slic3r/GUI/Plater.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 3fa4b4c022..162c8b09bf 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -902,13 +902,17 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame) this->q->Bind(EVT_UA_ID_USER_SUCCESS, [this](UserAccountSuccessEvent& evt) { // There are multiple handlers and we want to notify all evt.Skip(); + std::string who = user_account->get_username(); std::string username; if (user_account->on_user_id_success(evt.data, username)) { - std::string text = format(_u8L("Logged to Prusa Account as %1%."), username); - // login notification - this->notification_manager->close_notification_of_type(NotificationType::UserAccountID); - // show connect tab - this->notification_manager->push_notification(NotificationType::UserAccountID, NotificationManager::NotificationLevel::ImportantNotificationLevel, text); + // Do not show notification on refresh. + if (who != username) { + std::string text = format(_u8L("Logged to Prusa Account as %1%."), username); + // login notification + this->notification_manager->close_notification_of_type(NotificationType::UserAccountID); + // show connect tab + this->notification_manager->push_notification(NotificationType::UserAccountID, NotificationManager::NotificationLevel::ImportantNotificationLevel, text); + } this->main_frame->add_connect_webview_tab(); // Update User name in TopBar this->main_frame->refresh_account_menu();