Commit ebcd1dbe authored by nanahira's avatar nanahira

fix current server selection problem

parent ad8895cd
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
<div class="row small-gutters"> <div class="row small-gutters">
<div class="col-sm-4 input-group input-group-sm"> <div class="col-sm-4 input-group input-group-sm">
<label class="input-group-text" id="server-label">环境</label> <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"> <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">{{server.name}}</option> <option *ngFor="let server of selectableServers" [value]="server.id">{{server.name}}</option>
</select> </select>
</div> </div>
<div class="col-sm-8 input-group input-group-sm"> <div class="col-sm-8 input-group input-group-sm">
......
...@@ -184,14 +184,14 @@ export class YGOProComponent implements OnInit, OnDestroy, AfterViewInit, OnChan ...@@ -184,14 +184,14 @@ export class YGOProComponent implements OnInit, OnDestroy, AfterViewInit, OnChan
// points: Points; // points: Points;
servers: Server[] = []; servers: Server[] = [];
selectableServers: Server[] = []; selectableServers: Server[] = [];
// selectingServerId: string; selectingServerId: string;
currentServer: Server; currentServer: Server;
// tslint:disable-next-line:member-ordering // tslint:disable-next-line:member-ordering
rooms_loading = true; rooms_loading = true;
/*reloadCurrentServer() { reloadCurrentServer() {
this.currentServer = this.servers.find(s => s.id === this.selectingServerId); this.currentServer = this.servers.find(s => s.id === this.selectingServerId)!;
}*/ }
lastDeckFormat?: RegExp; lastDeckFormat?: RegExp;
lastCategoryFormat?: RegExp; lastCategoryFormat?: RegExp;
default_options: Options = { default_options: Options = {
...@@ -352,6 +352,7 @@ export class YGOProComponent implements OnInit, OnDestroy, AfterViewInit, OnChan ...@@ -352,6 +352,7 @@ export class YGOProComponent implements OnInit, OnDestroy, AfterViewInit, OnChan
this.servers = this.ygoproData.servers; this.servers = this.ygoproData.servers;
this.selectableServers = this.servers.filter((s) => !s.hidden); this.selectableServers = this.servers.filter((s) => !s.hidden);
this.currentServer = this.selectableServers[0]; this.currentServer = this.selectableServers[0];
this.selectingServerId = this.currentServer.id;
// this.reloadCurrentServer(); // this.reloadCurrentServer();
if (this.ygoproData.ygopro.lastDeckFormat) { 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