Skip to content

Commit 7e3c53f

Browse files
committed
feat(platform): fix "auto upgrade: specific shouldn't be reset if protocol version not upgrade" bug
1 parent 0804cea commit 7e3c53f

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

‎contributes/meta3d-ui-control-textcolored/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meta3d-ui-control-textcolored",
3-
"version": "1.3.3",
3+
"version": "1.3.4",
44
"displayName": "带颜色的文字",
55
"publisher": "meta3d",
66
"description": "",
@@ -19,7 +19,7 @@
1919
"dependencies": {
2020
"meta3d-editor-whole-protocol": "^1.3.0",
2121
"meta3d-type": "^1.3.0",
22-
"meta3d-ui-control-textcolored-protocol": "^1.3.0"
22+
"meta3d-ui-control-textcolored-protocol": "^1.3.1"
2323
},
2424
"devDependencies": {
2525
"clean-webpack-plugin": "^4.0.0",

‎doc/1.3.1.org‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,8 @@ TODO run test
715715
extract id
716716

717717

718-
TODO fix: after auto upgrade, color change back
718+
# TODO fix: after auto upgrade, specific shouldn't be reset if not change
719+
TODO fix: after auto upgrade, specific shouldn't be reset if protocol version not change
719720

720721

721722
TODO handle all bookmarks

‎platform/frontend/src/external_layer/ui/app/assemble_space/components/element_assemble/store/ElementAssembleStore.res‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ let reducer = (state, action) => {
323323
dragId,
324324
dropId,
325325
dropPosition,
326-
) => !dropToGap &&
326+
) =>
327+
!dropToGap &&
327328
!hasChildren(.
328329
serializeUIControlProtocolConfigLib(.
329330
(
@@ -448,6 +449,7 @@ let reducer = (state, action) => {
448449
}
449450
}
450451
}
452+
451453
| SetSpecificData(id, specific) =>
452454
_setUIControlInspectorData(
453455
state,
@@ -731,12 +733,17 @@ let reducer = (state, action) => {
731733
})
732734

733735
state->_updateAllUIControlInspectorData(data => {
734-
let name = (
736+
let selectedUIControlData =
735737
_findSelectUIControlById(state, data.id)->Meta3dCommonlib.OptionSt.getExn
736-
).data.contributePackageData.name
738+
let name = selectedUIControlData.data.contributePackageData.name
739+
let protocolVersion = selectedUIControlData.data.contributePackageData.protocol.version
737740

738741
switch selectedUIControls->Meta3dCommonlib.ListSt.find(({data}) => {
739-
data.contributePackageData.name == name
742+
data.contributePackageData.name == name &&
743+
Meta3d.Semver.gt(
744+
Meta3d.Semver.minVersion(data.contributePackageData.protocol.version),
745+
Meta3d.Semver.minVersion(protocolVersion),
746+
)
740747
}) {
741748
| Some({protocolConfigStr}) => {
742749
...data,

0 commit comments

Comments
 (0)