File tree Expand file tree Collapse file tree 4 files changed +41
-10
lines changed Expand file tree Collapse file tree 4 files changed +41
-10
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " Lytical" ,
3
3
"author" : " downthecrop" ,
4
4
"description" : " Lytical is an open source League of Legends statistics and profile analytics tool for all regions including Garena & WeGame" ,
5
- "version" : " 1.0.4 " ,
5
+ "version" : " 1.0.5 " ,
6
6
"private" : true ,
7
7
"scripts" : {
8
8
"serve" : " vue-cli-service serve" ,
Original file line number Diff line number Diff line change @@ -17,9 +17,11 @@ protocol.registerSchemesAsPrivileged([
17
17
{ scheme : 'app' , privileges : { secure : true , standard : true } } ,
18
18
] ) ;
19
19
20
+ let win ;
21
+
20
22
async function createWindow ( ) {
21
23
// Create the browser window.
22
- const win = new BrowserWindow ( {
24
+ win = new BrowserWindow ( {
23
25
width : 1200 ,
24
26
height : 650 ,
25
27
webPreferences : {
@@ -170,6 +172,18 @@ function getPlayerDataByName(name, auth) {
170
172
171
173
ipcMain . on ( 'asynchronous-message' , ( event , req ) => {
172
174
console . log ( 'new request: ' , req ) ;
175
+
176
+ // ipc required requests for debug/versioning
177
+ if ( req . id === 'openDevTools' ) {
178
+ win . webContents . openDevTools ( ) ;
179
+ return ;
180
+ }
181
+ if ( req . id === 'getVersion' ) {
182
+ event . reply ( 'asynchronous-reply' , { reply_type : 'appVersion' , version : app . getVersion ( ) } ) ;
183
+ return ;
184
+ }
185
+
186
+ // LCU related Requests
173
187
lcu . getLCUAuth ( ) . then ( ( auth ) => {
174
188
switch ( req . id ) {
175
189
case 'current-summoner' : {
Original file line number Diff line number Diff line change @@ -61,12 +61,14 @@ export default {
61
61
},
62
62
reload () {
63
63
if (this .viewingHome ) {
64
+ // eslint-disable-next-line no-underscore-dangle
65
+ const name = this .$router .currentRoute ._value .params .summonerSearch || ' ' ;
64
66
this .$router .push ({
65
67
name: ' Home' ,
66
68
// Appending a blank space to the end of the username allow the route to update
67
69
// Tried the this.$router.go() but the params got eaten..
68
70
// eslint-disable-next-line no-underscore-dangle
69
- params: { summonerSearch: ` ${ this . $router . currentRoute . _value . params . summonerSearch } ` },
71
+ params: { summonerSearch: ` ${ name } ` },
70
72
});
71
73
} else {
72
74
this .$router .go ();
Original file line number Diff line number Diff line change 33
33
</table >
34
34
</div >
35
35
<div >
36
- <h3 >Error Log</h3 >
37
- <textarea v-model =" errorlog" class =" errorLog" ></textarea >
36
+ <h3 >Debug</h3 >
37
+ <span >Version: {{version}}</span ><br >
38
+ <button @click =" openDevTools" >Open Dev Tools</button >
38
39
</div >
39
40
</div >
40
41
</template >
41
42
42
43
<script >
44
+ const { ipcRenderer } = require (' electron' );
45
+
43
46
export default {
44
47
name: ' SettingsMenu' ,
45
48
mounted () {
@@ -49,21 +52,33 @@ export default {
49
52
if (localStorage .showSoloGames ) this .showSoloGames = localStorage .getItem (' showSoloGames' );
50
53
if (localStorage .showFlexGames ) this .showFlexGames = localStorage .getItem (' showFlexGames' );
51
54
if (localStorage .showNormalGames ) this .showNormalGames = localStorage .getItem (' showNormalGames' );
52
- window .onerror = (errorMsg , url , lineNumber ) => {
53
- this .errorlog += ` Error occured: ${ errorMsg} on line ${ lineNumber} \n ` ;
54
- return false ;
55
- };
55
+ ipcRenderer .on (' asynchronous-reply' , (event , data ) => {
56
+ if (data .reply_type === ' appVersion' ) {
57
+ this .version = data .version ;
58
+ }
59
+ });
60
+ ipcRenderer .send (' asynchronous-message' , {
61
+ id: ' getVersion' ,
62
+ });
56
63
},
57
64
data () {
58
65
return {
59
- errorlog: ' ' ,
66
+ errorLog: [],
67
+ version: ' ' ,
60
68
autoSwitchLobby: ' true' ,
61
69
statsSite: ' opgg' ,
62
70
showSoloGames: ' true' ,
63
71
showFlexGames: ' true' ,
64
72
showNormalGames: ' true' ,
65
73
};
66
74
},
75
+ methods: {
76
+ openDevTools () {
77
+ ipcRenderer .send (' asynchronous-message' , {
78
+ id: ' openDevTools' ,
79
+ });
80
+ },
81
+ },
67
82
watch: {
68
83
// Keep local storage in sync
69
84
autoSwitchLobby (state ) {
You can’t perform that action at this time.
0 commit comments