Move presync callback functionality from SkyBrowserModule to ServerModule in order to expose the functionality to other topics as well

This commit is contained in:
Ylva Selling
2022-06-01 15:06:40 -04:00
parent fed07a0847
commit c9a63274a8
5 changed files with 44 additions and 43 deletions
@@ -55,7 +55,7 @@ SkyBrowserTopic::SkyBrowserTopic()
SkyBrowserTopic::~SkyBrowserTopic() {
if (_targetDataCallbackHandle != UnsetOnChangeHandle) {
SkyBrowserModule* module = global::moduleEngine->module<SkyBrowserModule>();
ServerModule* module = global::moduleEngine->module<ServerModule>();
if (module) {
module->removePreSyncCallback(_targetDataCallbackHandle);
}
@@ -78,7 +78,7 @@ void SkyBrowserTopic::handleJson(const nlohmann::json& json) {
return;
}
SkyBrowserModule* module = global::moduleEngine->module<SkyBrowserModule>();
ServerModule* module = global::moduleEngine->module<ServerModule>();
_targetDataCallbackHandle = module->addPreSyncCallback(
[this]() {
std::chrono::system_clock::time_point now = std::chrono::system_clock::now();