mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-22 04:51:47 +00:00
Start trying to sync parenting-to-nil (deleting)
This commit is contained in:
parent
5d9bc4473c
commit
44041f33e3
1 changed files with 11 additions and 1 deletions
|
|
@ -120,6 +120,8 @@ function ServeSession:__onInstanceChanged(instance, propertyName)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local remove = nil
|
||||||
|
|
||||||
local update = {
|
local update = {
|
||||||
id = instanceId,
|
id = instanceId,
|
||||||
changedProperties = {},
|
changedProperties = {},
|
||||||
|
|
@ -127,6 +129,14 @@ function ServeSession:__onInstanceChanged(instance, propertyName)
|
||||||
|
|
||||||
if propertyName == "Name" then
|
if propertyName == "Name" then
|
||||||
update.changedName = instance.Name
|
update.changedName = instance.Name
|
||||||
|
elseif propertyName == "Parent" then
|
||||||
|
if instance.Parent == nil then
|
||||||
|
update = nil
|
||||||
|
remove = instanceId
|
||||||
|
else
|
||||||
|
Log.warn("Cannot sync non-nil Parent property changes yet")
|
||||||
|
return
|
||||||
|
end
|
||||||
else
|
else
|
||||||
local success, encoded = self.__reconciler:encodeApiValue(instance[propertyName])
|
local success, encoded = self.__reconciler:encodeApiValue(instance[propertyName])
|
||||||
|
|
||||||
|
|
@ -139,7 +149,7 @@ function ServeSession:__onInstanceChanged(instance, propertyName)
|
||||||
end
|
end
|
||||||
|
|
||||||
local patch = {
|
local patch = {
|
||||||
removed = {},
|
removed = {remove},
|
||||||
added = {},
|
added = {},
|
||||||
updated = {update},
|
updated = {update},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue