mirror of
https://gitea.tendokyu.moe/ppc/amnet.git
synced 2026-09-30 02:38:09 +03:00
don't apply data in connect method
This commit is contained in:
@@ -11,20 +11,15 @@ export class AMServer extends Realm.Object<AMServer> implements AMServerInfoResp
|
||||
createdAt: Date;
|
||||
apiVersion: number;
|
||||
|
||||
async connect(abort?: AbortSignal | undefined): Promise<boolean> {
|
||||
async connect(abort?: AbortSignal | undefined): Promise<AMServerInfoResponse> {
|
||||
try {
|
||||
const response = await fetch(this.serverAddress, {
|
||||
signal: abort
|
||||
});
|
||||
|
||||
const data: AMServerInfoResponse = await response.json();
|
||||
|
||||
this.lastUsed = new Date();
|
||||
Object.apply(this, data);
|
||||
|
||||
return true;
|
||||
return await response.json();
|
||||
} catch {
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user