Closed recluse4615 closed 1 year ago
https://github.com/minetest-world/mtlauncher/blob/main/src/routes/%2Blayout.svelte#L104
server
here is a full server object, which should include 2 fields:
proto_min
proto_max
the "recommended version" can be figured out like so:
import { getVersions } from '$lib/api/versions';
// ...
let server = { ... };
let recommendedVersion = getVersions().filter(i => i.branch.protocolVersion === server.proto_max && !i.branch.isDev);
the best way to do this would probably be to subscribe
to selectedServer
like so:
selectedServer.subscribe(val => {
if (val.hasOwnProperty('proto_max')) {
let recommendedVersion = getVersions().filter(i => i.branch.protocolVersion === server.proto_max && !i.branch.isDev);
$selectedVersion = recommendedVersion;
}
});
might need some testing/extra reactive-ness tho
resolved in v0.0.2
tl;dr -
it would probably be best to modify
$selectedVersion
when selecting a server in theServerListTable.svelte
, that way the rest of the application can "catch on" and prompt to install the specific maximum version needed