UI: Fix incorrect information given in pserv upgrade error msg. (#1602)

This commit is contained in:
Sol 2024-08-22 01:48:55 +01:00 committed by GitHub
parent 818d7446be
commit 8d9f63f49f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -47,7 +47,7 @@ export const getPurchasedServerUpgradeCost = (hostname: string, ram: number): nu
if (isNaN(ram) || !isPowerOfTwo(ram) || !(Math.sign(ram) === 1))
throw new Error(`${ram} is not a positive power of 2`);
if (server.maxRam >= ram)
throw new Error(`'${hostname}' current ram (${server.maxRam}) is not bigger than new ram (${ram})`);
throw new Error(`The new ram of '${hostname}' (${ram}) must be bigger than its current ram (${server.maxRam}).`);
return getPurchaseServerCost(ram) - getPurchaseServerCost(server.maxRam);
};