mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-24 15:01:38 +00:00
Implement DataModel name change removal in PatchSet and adjust session handling in App
- Added a new function to PatchSet to remove the DataModel name change from updates, preventing unwanted synchronization of the project name. - Updated the App:startSession method to conditionally skip session lock acquisition and release based on one-shot mode settings. - Enhanced the confirmation callback to utilize the new PatchSet function for filtering DataModel name changes from patches.
This commit is contained in:
parent
240c225be0
commit
77088eccd8
3 changed files with 62 additions and 42 deletions
|
|
@ -394,6 +394,34 @@ function PatchSet.updatedIdList(patchSet): { string }
|
|||
return table.freeze(idList)
|
||||
end
|
||||
|
||||
--[[
|
||||
Remove the Name property change from the DataModel update in the patch.
|
||||
This prevents the project name from being synced, which is usually
|
||||
unwanted as Studio manages the DataModel name independently.
|
||||
Mutates the patch in place for efficiency.
|
||||
]]
|
||||
function PatchSet.removeDataModelName(patchSet, instanceMap)
|
||||
local dataModelId = instanceMap.fromInstances[game]
|
||||
if dataModelId == nil then
|
||||
return
|
||||
end
|
||||
|
||||
for i, update in ipairs(patchSet.updated) do
|
||||
if update.id == dataModelId and update.changedName ~= nil then
|
||||
update.changedName = nil
|
||||
-- Remove update entirely if no other changes remain
|
||||
if
|
||||
update.changedClassName == nil
|
||||
and update.changedMetadata == nil
|
||||
and next(update.changedProperties) == nil
|
||||
then
|
||||
table.remove(patchSet.updated, i)
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
Create a list of human-readable statements summarizing the contents of this
|
||||
patch, intended to be displayed to users.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue