Skip to content

Commit 543fc38

Browse files
committed
Bump version, resolve undefined summoner error
1 parent 88c9931 commit 543fc38

File tree

4 files changed

+41
-10
lines changed

4 files changed

+41
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Lytical",
33
"author": "downthecrop",
44
"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",
66
"private": true,
77
"scripts": {
88
"serve": "vue-cli-service serve",

src/background.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ protocol.registerSchemesAsPrivileged([
1717
{ scheme: 'app', privileges: { secure: true, standard: true } },
1818
]);
1919

20+
let win;
21+
2022
async function createWindow() {
2123
// Create the browser window.
22-
const win = new BrowserWindow({
24+
win = new BrowserWindow({
2325
width: 1200,
2426
height: 650,
2527
webPreferences: {
@@ -170,6 +172,18 @@ function getPlayerDataByName(name, auth) {
170172

171173
ipcMain.on('asynchronous-message', (event, req) => {
172174
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
173187
lcu.getLCUAuth().then((auth) => {
174188
switch (req.id) {
175189
case 'current-summoner': {

src/components/Navbar.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ export default {
6161
},
6262
reload() {
6363
if (this.viewingHome) {
64+
// eslint-disable-next-line no-underscore-dangle
65+
const name = this.$router.currentRoute._value.params.summonerSearch || '';
6466
this.$router.push({
6567
name: 'Home',
6668
// Appending a blank space to the end of the username allow the route to update
6769
// Tried the this.$router.go() but the params got eaten..
6870
// eslint-disable-next-line no-underscore-dangle
69-
params: { summonerSearch: `${this.$router.currentRoute._value.params.summonerSearch} ` },
71+
params: { summonerSearch: `${name} ` },
7072
});
7173
} else {
7274
this.$router.go();

src/components/SettingsMenu.vue

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@
3333
</table>
3434
</div>
3535
<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>
3839
</div>
3940
</div>
4041
</template>
4142

4243
<script>
44+
const { ipcRenderer } = require('electron');
45+
4346
export default {
4447
name: 'SettingsMenu',
4548
mounted() {
@@ -49,21 +52,33 @@ export default {
4952
if (localStorage.showSoloGames) this.showSoloGames = localStorage.getItem('showSoloGames');
5053
if (localStorage.showFlexGames) this.showFlexGames = localStorage.getItem('showFlexGames');
5154
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+
});
5663
},
5764
data() {
5865
return {
59-
errorlog: '',
66+
errorLog: [],
67+
version: '',
6068
autoSwitchLobby: 'true',
6169
statsSite: 'opgg',
6270
showSoloGames: 'true',
6371
showFlexGames: 'true',
6472
showNormalGames: 'true',
6573
};
6674
},
75+
methods: {
76+
openDevTools() {
77+
ipcRenderer.send('asynchronous-message', {
78+
id: 'openDevTools',
79+
});
80+
},
81+
},
6782
watch: {
6883
// Keep local storage in sync
6984
autoSwitchLobby(state) {

0 commit comments

Comments
 (0)