Expose option to force the sync history type when opening a realm (#966)

This commit is contained in:
Yavor Georgiev 2017-04-18 13:41:07 +03:00 committed by GitHub
parent 2ca08161f8
commit 8b652b4e8a

View File

@ -399,7 +399,9 @@ template<typename T>
void SyncClass<T>::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"));