Skip to content

Commit

Permalink
fix: Should reset selected version if runrime change
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Dec 28, 2023
1 parent 9c8d116 commit 4680f2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xmcl-keystone-ui/src/util/instanceModLoaderDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function useInstanceModLoaderDefault(path: Ref<string>, runtime: Ref<Runt
...runtime.value,
fabricLoader: version.version,
},
version: '',
})
return true
}
Expand All @@ -35,6 +36,7 @@ export function useInstanceModLoaderDefault(path: Ref<string>, runtime: Ref<Runt
...runtime.value,
quiltLoader: version.version,
},
version: '',
})
return true
}
Expand All @@ -48,6 +50,7 @@ export function useInstanceModLoaderDefault(path: Ref<string>, runtime: Ref<Runt
...runtime.value,
forge: version.version,
},
version: '',
})
return true
}
Expand All @@ -61,6 +64,7 @@ export function useInstanceModLoaderDefault(path: Ref<string>, runtime: Ref<Runt
...runtime.value,
neoForged: version,
},
version: '',
})
return true
}
Expand Down
5 changes: 5 additions & 0 deletions xmcl-runtime/instance/InstanceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,11 @@ export class InstanceService extends StatefulService<InstanceState> implements I
}
}

if (result.runtime && state.version && typeof result.version === 'undefined') {
// Reset the version if the runtime is changed
result.version = ''
}

if ('server' in options) {
if (options.server) {
if (options.server.host !== state.server?.host || options.server.port !== state.server.port) {
Expand Down

0 comments on commit 4680f2d

Please sign in to comment.