Commit a6591636 authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent 5020a190
...@@ -123,14 +123,14 @@ export class YGOProComponent implements OnInit { ...@@ -123,14 +123,14 @@ export class YGOProComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.system_conf = path.join((<AppLocal>this.app.local).path, 'system.conf'); this.system_conf = path.join(this.app.local!.path, 'system.conf');
this.refresh(); this.refresh();
let modal = $('#game-list-modal'); let modal = $('#game-list-modal');
modal.on('show.bs.modal', () => { modal.on('show.bs.modal', () => {
this.connections = this.servers.map((server) => { this.connections = this.servers.map((server) => {
let connection = new WebSocket(<string>server.url); let connection = new WebSocket(server.url!);
connection.onclose = () => { connection.onclose = () => {
this.rooms = this.rooms.filter(room => room.server != server) this.rooms = this.rooms.filter(room => room.server != server)
}; };
...@@ -174,7 +174,7 @@ export class YGOProComponent implements OnInit { ...@@ -174,7 +174,7 @@ export class YGOProComponent implements OnInit {
get_decks(): Promise<string[]> { get_decks(): Promise<string[]> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
fs.readdir(path.join((<AppLocal>this.app.local).path, 'deck'), (error, files) => { fs.readdir(path.join(this.app.local!.path, 'deck'), (error, files) => {
if (error) { if (error) {
resolve([]) resolve([])
} else { } else {
...@@ -196,7 +196,7 @@ export class YGOProComponent implements OnInit { ...@@ -196,7 +196,7 @@ export class YGOProComponent implements OnInit {
} }
async delete_deck(deck: string) { async delete_deck(deck: string) {
await new Promise(resolve => fs.unlink(path.join((<AppLocal>this.app.local).path, 'deck', deck + '.ydk'), resolve)); await new Promise(resolve => fs.unlink(path.join(this.app.local!.path, 'deck', deck + '.ydk'), resolve));
return this.refresh() return this.refresh()
} }
...@@ -297,7 +297,7 @@ export class YGOProComponent implements OnInit { ...@@ -297,7 +297,7 @@ export class YGOProComponent implements OnInit {
options_buffer.writeUInt16LE(options_buffer.readUInt16LE(i) ^ secret, i) options_buffer.writeUInt16LE(options_buffer.readUInt16LE(i) ^ secret, i)
} }
let password = options_buffer.toString('base64') + (<string>options.title).replace(/\s/, String.fromCharCode(0xFEFF)); let password = options_buffer.toString('base64') + (options.title!).replace(/\s/, String.fromCharCode(0xFEFF));
let room_id = crypto.createHash('md5').update(password + this.loginService.user.username).digest('base64').slice(0, 10).replace('+', '-').replace('/', '_'); let room_id = crypto.createHash('md5').update(password + this.loginService.user.username).digest('base64').slice(0, 10).replace('+', '-').replace('/', '_');
this.join(password, this.servers[0]); this.join(password, this.servers[0]);
...@@ -320,7 +320,7 @@ export class YGOProComponent implements OnInit { ...@@ -320,7 +320,7 @@ export class YGOProComponent implements OnInit {
let password = options_buffer.toString('base64') + room.id; let password = options_buffer.toString('base64') + room.id;
this.join(password, <Server>room.server); this.join(password, room.server!);
} }
matching: ISubscription | null; matching: ISubscription | null;
...@@ -350,7 +350,7 @@ export class YGOProComponent implements OnInit { ...@@ -350,7 +350,7 @@ export class YGOProComponent implements OnInit {
} }
cancel_match() { cancel_match() {
(<ISubscription>this.matching).unsubscribe(); this.matching!.unsubscribe();
this.matching = null; this.matching = null;
this.matching_arena = null; this.matching_arena = null;
} }
......
This diff is collapsed.
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