diff --git a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml index 0ab0902d52..c6d8fa9e79 100644 --- a/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml +++ b/atomic_defi_design/Dex/Dashboard/NotificationsModal.qml @@ -29,8 +29,6 @@ DexPopup readonly property string enablingCoinFailedStatusNotification: "onEnablingCoinFailedStatus" readonly property string disablingCoinFailedStatus: "onDisablingCoinFailedStatus" readonly property string endpointNonReacheableStatus: "onEndpointNonReacheableStatus" - readonly property string mismatchCustomCoinConfigurationNotification: "onMismatchCustomCoinConfiguration" - readonly property string batchFailedNotification: "onBatchFailed" readonly property string check_internet_connection_text: qsTr("Please check your internet connection (e.g. VPN service or firewall might block it).") @@ -182,10 +180,6 @@ DexPopup return qsTr("Failed to disable %1", "TICKER").arg(notification.params.coin) case endpointNonReacheableStatus: return qsTr("Endpoint not reachable") - case mismatchCustomCoinConfigurationNotification: - return qsTr("Mismatch at %1 custom asset configuration", "TICKER").arg(notification.params.asset) - case batchFailedNotification: - return qsTr("Batch %1 failed. Reason: %2").arg(notification.params.from).arg(notification.params.reason) } } @@ -205,10 +199,6 @@ DexPopup return "" case endpointNonReacheableStatus: return notification.params.base_uri - case mismatchCustomCoinConfigurationNotification: - return qsTr("Application needs to be restarted for %1 custom asset.", "TICKER").arg(notification.params.asset) - case batchFailedNotification: - return notification.params.reason } } @@ -301,16 +291,6 @@ DexPopup return } - // Check if there is mismatch error, ignore this one - for (let n of notifications_list) - { - if (n.event_name === mismatchCustomCoinConfigurationNotification && n.params.asset === coin) - { - console.trace() - return - } - } - error = check_internet_connection_text + "\n\n" + error newNotification( @@ -361,37 +341,6 @@ DexPopup toast.show(qsTr("Endpoint not reachable"), General.time_toast_important_error, error) } - function onMismatchCustomCoinConfiguration(asset, human_date, timestamp) - { - newNotification( - mismatchCustomCoinConfigurationNotification, - { - asset, - human_date, - timestamp - }, - timestamp, - human_date) - - toast.show(title, General.time_toast_important_error, "", true, true) - } - - function onBatchFailed(reason, from, human_date, timestamp) - { - newNotification( - batchFailedNotification, - { - human_date, - timestamp, - reason, - from - }, - timestamp, - human_date) - - toast.show(title, General.time_toast_important_error, reason) - } - Component.onCompleted: { API.app.notification_mgr.updateSwapStatus.connect(onUpdateSwapStatus) @@ -400,8 +349,6 @@ DexPopup API.app.notification_mgr.enablingCoinFailedStatus.connect(onEnablingCoinFailedStatus) API.app.notification_mgr.disablingCoinFailedStatus.connect(onDisablingCoinFailedStatus) API.app.notification_mgr.endpointNonReacheableStatus.connect(onEndpointNonReacheableStatus) - API.app.notification_mgr.mismatchCustomCoinConfiguration.connect(onMismatchCustomCoinConfiguration) - API.app.notification_mgr.batchFailed.connect(onBatchFailed) } Component.onDestruction: @@ -412,8 +359,6 @@ DexPopup API.app.notification_mgr.enablingCoinFailedStatus.disconnect(onEnablingCoinFailedStatus) API.app.notification_mgr.disablingCoinFailedStatus.disconnect(onDisablingCoinFailedStatus) API.app.notification_mgr.endpointNonReacheableStatus.disconnect(onEndpointNonReacheableStatus) - API.app.notification_mgr.mismatchCustomCoinConfiguration.disconnect(onMismatchCustomCoinConfiguration) - API.app.notification_mgr.batchFailed.disconnect(onBatchFailed) } SystemTrayIcon @@ -622,9 +567,6 @@ DexPopup case enablingCoinFailedStatusNotification: name = "repeat" break - case mismatchCustomCoinConfigurationNotification: - name = "restart-alert" - break default: name = "check" break @@ -653,12 +595,6 @@ DexPopup API.app.enable_coins([event_before_removal.params.coin]) break - case mismatchCustomCoinConfigurationNotification: - console.log("Restarting for", event_before_removal.params.asset, "custom asset configuration mismatch...") - root.close() - restart_modal.open() - break - default: removeNotification() break diff --git a/src/core/atomicdex/events/events.hpp b/src/core/atomicdex/events/events.hpp index 9f19cd0f7f..084e39b9f5 100644 --- a/src/core/atomicdex/events/events.hpp +++ b/src/core/atomicdex/events/events.hpp @@ -68,17 +68,6 @@ namespace atomic_dex std::string reason; }; - struct batch_failed - { - std::string from; - std::string reason; - }; - - struct mismatch_configuration_custom_coin - { - std::string coin; - }; - struct endpoint_nonreacheable { std::string base_uri; diff --git a/src/core/atomicdex/managers/notification.manager.cpp b/src/core/atomicdex/managers/notification.manager.cpp index b39c71c857..e57fb22971 100644 --- a/src/core/atomicdex/managers/notification.manager.cpp +++ b/src/core/atomicdex/managers/notification.manager.cpp @@ -37,28 +37,24 @@ namespace atomic_dex void notification_manager::connect_signals() { - m_dispatcher.sink().connect<¬ification_manager::on_batch_failed>(*this); m_dispatcher.sink().connect<¬ification_manager::on_swap_status_notification>(*this); m_dispatcher.sink().connect<¬ification_manager::on_balance_update_notification>(*this); m_dispatcher.sink().connect<¬ification_manager::on_enabling_z_coin_status>(*this); m_dispatcher.sink().connect<¬ification_manager::on_enabling_coin_failed>(*this); m_dispatcher.sink().connect<¬ification_manager::on_disabling_coin_failed>(*this); m_dispatcher.sink().connect<¬ification_manager::on_endpoint_nonreacheable>(*this); - m_dispatcher.sink().connect<¬ification_manager::on_mismatch_custom_coins_configuration>(*this); m_dispatcher.sink().connect<¬ification_manager::on_fatal_notification>(*this); } void notification_manager::disconnect_signals() { - m_dispatcher.sink().disconnect<¬ification_manager::on_batch_failed>(*this); m_dispatcher.sink().disconnect<¬ification_manager::on_swap_status_notification>(*this); m_dispatcher.sink().disconnect<¬ification_manager::on_balance_update_notification>(*this); m_dispatcher.sink().disconnect<¬ification_manager::on_enabling_coin_failed>(*this); m_dispatcher.sink().disconnect<¬ification_manager::on_disabling_coin_failed>(*this); m_dispatcher.sink().disconnect<¬ification_manager::on_enabling_z_coin_status>(*this); m_dispatcher.sink().disconnect<¬ification_manager::on_endpoint_nonreacheable>(*this); - m_dispatcher.sink().disconnect<¬ification_manager::on_mismatch_custom_coins_configuration>(*this); m_dispatcher.sink().disconnect<¬ification_manager::on_fatal_notification>(*this); } @@ -106,27 +102,10 @@ namespace atomic_dex QString human_date = QString::fromStdString(utils::to_human_date(timestamp, "%e %b %Y, %H:%M")); emit endpointNonReacheableStatus(QString::fromStdString(evt.base_uri), human_date, timestamp); } - void - notification_manager::on_mismatch_custom_coins_configuration(const mismatch_configuration_custom_coin& evt) - { - using namespace std::chrono; - qint64 timestamp = duration_cast(system_clock::now().time_since_epoch()).count(); - QString human_date = QString::fromStdString(utils::to_human_date(timestamp, "%e %b %Y, %H:%M")); - emit mismatchCustomCoinConfiguration(QString::fromStdString(evt.coin), human_date, timestamp); - } void notification_manager::on_fatal_notification(const fatal_notification& evt) { emit fatalNotification(QString::fromStdString(evt.message)); } - - void - notification_manager::on_batch_failed(const batch_failed& evt) - { - using namespace std::chrono; - qint64 timestamp = duration_cast(system_clock::now().time_since_epoch()).count(); - QString human_date = QString::fromStdString(utils::to_human_date(timestamp, "%e %b %Y, %H:%M")); - emit batchFailed(QString::fromStdString(evt.reason), QString::fromStdString(evt.from), human_date, timestamp); - } } // namespace atomic_dex diff --git a/src/core/atomicdex/managers/notification.manager.hpp b/src/core/atomicdex/managers/notification.manager.hpp index a9c01ecd87..a6c201cf4f 100644 --- a/src/core/atomicdex/managers/notification.manager.hpp +++ b/src/core/atomicdex/managers/notification.manager.hpp @@ -40,14 +40,12 @@ namespace atomic_dex void disconnect_signals() ; //! Callbacks - void on_batch_failed(const batch_failed& evt);; void on_swap_status_notification(const swap_status_notification& evt); void on_enabling_z_coin_status(const enabling_z_coin_status& evt); void on_enabling_coin_failed(const enabling_coin_failed& evt); void on_disabling_coin_failed(const disabling_coin_failed& evt); void on_balance_update_notification(const balance_update_notification& evt); void on_endpoint_nonreacheable(const endpoint_nonreacheable& evt); - void on_mismatch_custom_coins_configuration(const mismatch_configuration_custom_coin& evt); void on_fatal_notification(const fatal_notification& evt); signals: