fix(dui): stale load settings to existing model card (#94)

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
This commit is contained in:
Björn Steinhagen
2026-03-27 18:29:33 +02:00
committed by GitHub
parent 6f2f599b1b
commit 8fc81b0b4e
+10 -6
View File
@@ -178,21 +178,25 @@ const selectVersionAndAddModel = async (
if (existingModel) { if (existingModel) {
emit('close') emit('close')
// Patch the existing model card with new versions! const patchPayload: Record<string, unknown> = {
await hostAppStore.patchModel(existingModel.modelCardId, {
selectedVersionId: version.id, selectedVersionId: version.id,
selectedVersionSourceApp: version.sourceApplication, selectedVersionSourceApp: version.sourceApplication,
selectedVersionUserId: version.authorUser?.id, selectedVersionUserId: version.authorUser?.id,
latestVersionId: latestVersion.id, latestVersionId: latestVersion.id,
latestVersionSourceApp: latestVersion.sourceApplication, latestVersionSourceApp: latestVersion.sourceApplication,
latestVersionUserId: latestVersion.authorUser?.id latestVersionUserId: latestVersion.authorUser?.id
}) }
// apply new settings to the existing model card if they were changed
if (settingsWereChanged.value && receieveSettings.value) {
patchPayload.settings = receieveSettings.value
}
// patch the existing model card with new versions and settings
await hostAppStore.patchModel(existingModel.modelCardId, patchPayload)
await hostAppStore.receiveModel(existingModel.modelCardId, 'Wizard') await hostAppStore.receiveModel(existingModel.modelCardId, 'Wizard')
return return
} }
// We were tracking the source host app wrong before `getHostAppFromString`
// i.e. we were having `Revit 2023` instead of `revit`
const selectedVersionSourceApp = getSlugFromHostAppNameAndVersion( const selectedVersionSourceApp = getSlugFromHostAppNameAndVersion(
version.sourceApplication as string version.sourceApplication as string
) )