From a7384157633f75e1e086e09c91ce83c557e9b30c Mon Sep 17 00:00:00 2001 From: Kenneth Geisshirt Date: Wed, 27 Sep 2017 21:02:09 +0200 Subject: [PATCH] wip --- src/js_sync.hpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/js_sync.hpp b/src/js_sync.hpp index a9875953..df11d731 100644 --- a/src/js_sync.hpp +++ b/src/js_sync.hpp @@ -39,17 +39,13 @@ namespace realm { namespace js { -static bool config_fs_done = false; - realm::SyncManager& syncManagerShared() { - realm::SyncManager& shared = SyncManager::shared(); - if (!config_fs_done) { - // setup synced realmFile paths + static bool configured = []{ ensure_directory_exists_for_file(default_realm_file_directory()); - shared.configure_file_system(default_realm_file_directory(), SyncManager::MetadataMode::NoEncryption); - config_fs_done = true; - } - return shared; + SyncManager::shared().configure_file_system(default_realm_file_directory(), SyncManager::MetadataMode::NoEncryption); + return true; + }(); + return SyncManager::shared(); } using SharedUser = std::shared_ptr;