Commit f6780afd authored by 2breakegg's avatar 2breakegg

debug

parent 9b9f13f7
...@@ -2,7 +2,7 @@ import {Component, Renderer, ChangeDetectorRef, OnInit, ElementRef, ViewChild} f ...@@ -2,7 +2,7 @@ import {Component, Renderer, ChangeDetectorRef, OnInit, ElementRef, ViewChild} f
import {remote, shell} from 'electron'; import {remote, shell} from 'electron';
import {LoginService} from './login.service'; import {LoginService} from './login.service';
import {SettingsService} from './settings.sevices'; import {SettingsService} from './settings.sevices';
import * as $ from 'jquery'; import $ = require('jquery');
import 'bootstrap'; import 'bootstrap';
const autoUpdater: Electron.AutoUpdater = remote.getGlobal('autoUpdater'); const autoUpdater: Electron.AutoUpdater = remote.getGlobal('autoUpdater');
......
...@@ -237,6 +237,7 @@ export class YGOProComponent implements OnInit, OnDestroy { ...@@ -237,6 +237,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
replay: true replay: true
}); });
} }
} }
refresh_replay_rooms() { refresh_replay_rooms() {
...@@ -369,6 +370,11 @@ export class YGOProComponent implements OnInit, OnDestroy { ...@@ -369,6 +370,11 @@ export class YGOProComponent implements OnInit, OnDestroy {
} }
this.replay_connections = []; this.replay_connections = [];
}); });
remote.ipcMain.on('YGOPro', (e: any , type: string) => {
console.log('rrrrr')
this.request_match(type);
});
} }
...@@ -518,6 +524,7 @@ export class YGOProComponent implements OnInit, OnDestroy { ...@@ -518,6 +524,7 @@ export class YGOProComponent implements OnInit, OnDestroy {
let exp_rank_ex: number; let exp_rank_ex: number;
let arena_rank_ex: number; let arena_rank_ex: number;
let win = remote.getCurrentWindow(); let win = remote.getCurrentWindow();
win.minimize(); win.minimize();
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
let child = child_process.spawn(path.join(this.app.local!.path, this.app.actions.get('main')!.execute), args, { let child = child_process.spawn(path.join(this.app.local!.path, this.app.actions.get('main')!.execute), args, {
...@@ -709,6 +716,8 @@ export class YGOProComponent implements OnInit, OnDestroy { ...@@ -709,6 +716,8 @@ export class YGOProComponent implements OnInit, OnDestroy {
clearInterval(this.match_interval); clearInterval(this.match_interval);
this.match_interval = undefined; this.match_interval = undefined;
} }
remote.ipcMain.removeAllListeners('YGOPro');
} }
refresh_match() { refresh_match() {
......
...@@ -5,8 +5,6 @@ import * as $ from 'jquery'; ...@@ -5,8 +5,6 @@ import * as $ from 'jquery';
let data_url = (new URL(document.location.toString())).searchParams; let data_url = (new URL(document.location.toString())).searchParams;
let data_str = data_url.get('data'); let data_str = data_url.get('data');
console.log(data_str);
// { // {
// "usernamea": "Joe1991", // "usernamea": "Joe1991",
// "usernameb": "zh99998", // "usernameb": "zh99998",
...@@ -137,6 +135,8 @@ $('#rewards').append(tr_rewards); ...@@ -137,6 +135,8 @@ $('#rewards').append(tr_rewards);
function again() { function again() {
let {ipcRenderer} = require('electron'); let {ipcRenderer} = require('electron');
ipcRenderer.send('YGOPro', data.type); ipcRenderer.send('YGOPro', data.type);
window.opener=null;
window.close();
} }
let t = setTimeout(function () { let t = setTimeout(function () {
window.opener = null; window.opener = null;
......
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