mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 03:05:34 +00:00
Lint Code [skip actions]
This commit is contained in:
parent
6c97da3715
commit
3563d05685
@ -66,8 +66,7 @@ export function setTargetPlayer(player: number, token: string | null = null): vo
|
||||
*/
|
||||
export async function setServerDetails(newAddress: string | null, newPort: string | number | null): Promise<void> {
|
||||
if (!getWindowDetails().disable) {
|
||||
if (typeof newPort == "number")
|
||||
newPort = newPort.toString();
|
||||
if (typeof newPort == "number") newPort = newPort.toString();
|
||||
|
||||
// Apply the new details.
|
||||
if (newAddress != null) {
|
||||
|
@ -174,11 +174,8 @@ export function getWindowDetails(): WindowDetails {
|
||||
const { address, port, disable } = details;
|
||||
|
||||
return {
|
||||
address: (address as string).includes("DETAILS_ADDRESS")
|
||||
? "127.0.0.1" : address,
|
||||
port: (port as string).includes("DETAILS_PORT")
|
||||
? 443 : parseInt(port),
|
||||
disable: (disable as string).includes("DETAILS_DISABLE")
|
||||
? false : disable == "true"
|
||||
address: (address as string).includes("DETAILS_ADDRESS") ? "127.0.0.1" : address,
|
||||
port: (port as string).includes("DETAILS_PORT") ? 443 : parseInt(port),
|
||||
disable: (disable as string).includes("DETAILS_DISABLE") ? false : disable == "true"
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user