From 8b652b4e8adafcde26afcd3820276212b94ae11e Mon Sep 17 00:00:00 2001 From: Yavor Georgiev Date: Tue, 18 Apr 2017 13:41:07 +0300 Subject: [PATCH] Expose option to force the sync history type when opening a realm (#966) --- src/js_sync.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js_sync.hpp b/src/js_sync.hpp index 6776b9cd..369cfb5f 100644 --- a/src/js_sync.hpp +++ b/src/js_sync.hpp @@ -399,7 +399,9 @@ template void SyncClass::populate_sync_config(ContextType ctx, ObjectType realm_constructor, ObjectType config_object, Realm::Config& config) { ValueType sync_config_value = Object::get_property(ctx, config_object, "sync"); - if (!Value::is_undefined(ctx, sync_config_value)) { + if (Value::is_boolean(ctx, sync_config_value)) { + config.force_sync_history = Value::to_boolean(ctx, sync_config_value); + } else if (!Value::is_undefined(ctx, sync_config_value)) { auto sync_config_object = Value::validated_to_object(ctx, sync_config_value); ObjectType sync_constructor = Object::validated_get_object(ctx, realm_constructor, std::string("Sync"));