Commit ebcd1dbe authored by nanahira's avatar nanahira

fix current server selection problem

parent ad8895cd
......@@ -20,8 +20,8 @@
<div class="row small-gutters">
<div class="col-sm-4 input-group input-group-sm">
<label class="input-group-text" id="server-label">环境</label>
<select class="form-select form-select-sm" id="selectServer" name="server" [disabled]="!appsService.allReady(app)" [(ngModel)]="currentServer">
<option *ngFor="let server of selectableServers" [value]="server">{{server.name}}</option>
<select class="form-select form-select-sm" id="selectServer" name="server" [disabled]="!appsService.allReady(app)" [(ngModel)]="selectingServerId" (ngModelChange)="reloadCurrentServer()">
<option *ngFor="let server of selectableServers" [value]="server.id">{{server.name}}</option>
</select>
</div>
<div class="col-sm-8 input-group input-group-sm">
......
......@@ -184,14 +184,14 @@ export class YGOProComponent implements OnInit, OnDestroy, AfterViewInit, OnChan
// points: Points;
servers: Server[] = [];
selectableServers: Server[] = [];
// selectingServerId: string;
selectingServerId: string;
currentServer: Server;
// tslint:disable-next-line:member-ordering
rooms_loading = true;
/*reloadCurrentServer() {
this.currentServer = this.servers.find(s => s.id === this.selectingServerId);
}*/
reloadCurrentServer() {
this.currentServer = this.servers.find(s => s.id === this.selectingServerId)!;
}
lastDeckFormat?: RegExp;
lastCategoryFormat?: RegExp;
default_options: Options = {
......@@ -352,6 +352,7 @@ export class YGOProComponent implements OnInit, OnDestroy, AfterViewInit, OnChan
this.servers = this.ygoproData.servers;
this.selectableServers = this.servers.filter((s) => !s.hidden);
this.currentServer = this.selectableServers[0];
this.selectingServerId = this.currentServer.id;
// this.reloadCurrentServer();
if (this.ygoproData.ygopro.lastDeckFormat) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment