Skip to content

Commit

Permalink
Remove mismatch custom coin config event
Browse files Browse the repository at this point in the history
It's never triggered
  • Loading branch information
syl committed Nov 26, 2022
1 parent c5d7402 commit a84ec96
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 57 deletions.
41 changes: 0 additions & 41 deletions atomic_defi_design/Dex/Dashboard/NotificationsModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +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 check_internet_connection_text: qsTr("Please check your internet connection (e.g. VPN service or firewall might block it).")

Expand Down Expand Up @@ -181,8 +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)
}
}

Expand All @@ -202,8 +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)
}
}

Expand Down Expand Up @@ -296,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(
Expand Down Expand Up @@ -356,21 +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)
}

Component.onCompleted:
{
API.app.notification_mgr.updateSwapStatus.connect(onUpdateSwapStatus)
Expand All @@ -379,7 +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)
}

Component.onDestruction:
Expand All @@ -390,7 +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)
}

SystemTrayIcon
Expand Down Expand Up @@ -599,9 +567,6 @@ DexPopup
case enablingCoinFailedStatusNotification:
name = "repeat"
break
case mismatchCustomCoinConfigurationNotification:
name = "restart-alert"
break
default:
name = "check"
break
Expand Down Expand Up @@ -630,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
Expand Down
5 changes: 0 additions & 5 deletions src/core/atomicdex/events/events.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ namespace atomic_dex
std::string reason;
};

struct mismatch_configuration_custom_coin
{
std::string coin;
};

struct endpoint_nonreacheable
{
std::string base_uri;
Expand Down
10 changes: 0 additions & 10 deletions src/core/atomicdex/managers/notification.manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ namespace atomic_dex
m_dispatcher.sink<enabling_coin_failed>().connect<&notification_manager::on_enabling_coin_failed>(*this);
m_dispatcher.sink<disabling_coin_failed>().connect<&notification_manager::on_disabling_coin_failed>(*this);
m_dispatcher.sink<endpoint_nonreacheable>().connect<&notification_manager::on_endpoint_nonreacheable>(*this);
m_dispatcher.sink<mismatch_configuration_custom_coin>().connect<&notification_manager::on_mismatch_custom_coins_configuration>(*this);
m_dispatcher.sink<fatal_notification>().connect<&notification_manager::on_fatal_notification>(*this);
}

Expand All @@ -56,7 +55,6 @@ namespace atomic_dex
m_dispatcher.sink<disabling_coin_failed>().disconnect<&notification_manager::on_disabling_coin_failed>(*this);
m_dispatcher.sink<enabling_z_coin_status>().disconnect<&notification_manager::on_enabling_z_coin_status>(*this);
m_dispatcher.sink<endpoint_nonreacheable>().disconnect<&notification_manager::on_endpoint_nonreacheable>(*this);
m_dispatcher.sink<mismatch_configuration_custom_coin>().disconnect<&notification_manager::on_mismatch_custom_coins_configuration>(*this);
m_dispatcher.sink<fatal_notification>().disconnect<&notification_manager::on_fatal_notification>(*this);
}

Expand Down Expand Up @@ -104,14 +102,6 @@ namespace atomic_dex
QString human_date = QString::fromStdString(utils::to_human_date<std::chrono::seconds>(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<seconds>(system_clock::now().time_since_epoch()).count();
QString human_date = QString::fromStdString(utils::to_human_date<std::chrono::seconds>(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)
Expand Down
1 change: 0 additions & 1 deletion src/core/atomicdex/managers/notification.manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ namespace atomic_dex
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:
Expand Down

0 comments on commit a84ec96

Please sign in to comment.