mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Remove instanceMetadataMap from plugin
This commit is contained in:
parent
e23056ac2f
commit
c284b7de40
2 changed files with 6 additions and 9 deletions
|
|
@ -100,10 +100,9 @@ end
|
|||
local Reconciler = {}
|
||||
Reconciler.__index = Reconciler
|
||||
|
||||
function Reconciler.new(instanceMetadataMap)
|
||||
function Reconciler.new()
|
||||
local self = {
|
||||
instanceMap = makeInstanceMap(),
|
||||
instanceMetadataMap = instanceMetadataMap,
|
||||
}
|
||||
|
||||
return setmetatable(self, Reconciler)
|
||||
|
|
@ -176,7 +175,7 @@ function Reconciler:reconcile(virtualInstancesById, id, instance)
|
|||
end
|
||||
end
|
||||
|
||||
if self:__shouldClearUnknownInstances(id) then
|
||||
if self:__shouldClearUnknownInstances(virtualInstance) then
|
||||
for existingChildInstance in pairs(unvisitedExistingChildren) do
|
||||
self.instanceMap:removeInstance(existingChildInstance)
|
||||
existingChildInstance:Destroy()
|
||||
|
|
@ -204,9 +203,9 @@ function Reconciler:reconcile(virtualInstancesById, id, instance)
|
|||
return instance
|
||||
end
|
||||
|
||||
function Reconciler:__shouldClearUnknownInstances(id)
|
||||
if self.instanceMetadataMap[id] then
|
||||
return not self.instanceMetadataMap[id].ignoreUnknownInstances
|
||||
function Reconciler:__shouldClearUnknownInstances(virtualInstance)
|
||||
if virtualInstance.Metadata ~= nil then
|
||||
return not virtualInstance.Metadata.ignoreUnknownInstances
|
||||
else
|
||||
return true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ function Session.new(config)
|
|||
local self = {
|
||||
onError = config.onError,
|
||||
disconnected = false,
|
||||
reconciler = nil,
|
||||
reconciler = Reconciler.new(),
|
||||
api = api,
|
||||
}
|
||||
|
||||
|
|
@ -25,8 +25,6 @@ function Session.new(config)
|
|||
return Promise.resolve()
|
||||
end
|
||||
|
||||
self.reconciler = Reconciler.new(api.instanceMetadataMap)
|
||||
|
||||
return api:read({api.rootInstanceId})
|
||||
:andThen(function(response)
|
||||
if self.disconnected then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue