Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Oolonk committed May 21, 2023
1 parent a4aadc8 commit 1a136ee
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async function createMainWindow() {
show: false,
icon: path.join(__dirname, 'logo.png'),
autoHideMenuBar: true,
webPreferences: { devTools: _debug, experimentalFeatures: true, nodeIntegration: true, contextIsolation: false, enableRemoteModule: true }
webPreferences: { devTools: _debug, nodeIntegration: true, contextIsolation: false, enableRemoteModule: true }
});
require("@electron/remote/main").enable(mainWin.webContents);
mainWin.webContents.openDevTools();
Expand Down Expand Up @@ -142,7 +142,7 @@ function createWindow(event, arg) {
modal: arg.dialog || false,
autoHideMenuBar: true,
parent: arg.dialog ? BrowserWindow.fromWebContents(event.sender) : null,
webPreferences: { devTools: _debug, experimentalFeatures: true, nodeIntegration: true, contextIsolation: false, enableRemoteModule: true }
webPreferences: { devTools: _debug, nodeIntegration: true, contextIsolation: false, enableRemoteModule: true }
});
require("@electron/remote/main").enable(win.webContents);
let windowFile = `window/${arg.name}.html`;
Expand Down
7 changes: 4 additions & 3 deletions js/database-entry-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var smashggIgnore = {};

ipcRenderer.on("returnchannel", (event, data) => _returnChannel = data);

ipcRenderer.on("data", (event, data) => {
ipcRenderer.on("data", async (event, data) => {
dbName = data.db;
id = data.id;
if (data.entry) {
Expand All @@ -24,13 +24,14 @@ ipcRenderer.on("data", (event, data) => {
if (id == null) {
dataset = db.createStruct(dbName);
}
await startFunction();
});

smashgg.on("fetch-error", (e) => {
console.error(e);
});

window.addEventListener("load", async () => {
async function startFunction() {
await ipcRenderer.invoke("get", "smashgg-token").then(token => smashgg.Token = token);
await ipcRenderer.invoke("get", "smashgg").then(data => smashgg.SelectedTournament = data.tournament);

Expand All @@ -47,7 +48,7 @@ window.addEventListener("load", async () => {
for (let infoEl of document.querySelectorAll("#info > div")) {
infoEl.onclick = () => clipboard.writeText(infoEl.innerText, 'selection');
}
});
};

async function downloadPhotoFromSmashgg() {
let smashggId = parseInt(document.getElementById('field-smashgg').value);
Expand Down
7 changes: 4 additions & 3 deletions js2/database-entry-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var smashggIgnore = {};

ipcRenderer.on("returnchannel", (event, data) => _returnChannel = data);

ipcRenderer.on("data", (event, data) => {
ipcRenderer.on("data", async (event, data) => {
dbName = data.db;
id = data.id;
if (data.entry) {
Expand All @@ -24,13 +24,14 @@ ipcRenderer.on("data", (event, data) => {
if (id == null) {
dataset = db.createStruct(dbName);
}
await startFunction();
});

smashgg.on("fetch-error", (e) => {
console.error(e);
});

window.addEventListener("load", async () => {
async function startFunction() {
await ipcRenderer.invoke("get", "smashgg-token").then(token => smashgg.Token = token);
await ipcRenderer.invoke("get", "smashgg").then(data => smashgg.SelectedTournament = data.tournament);

Expand All @@ -47,7 +48,7 @@ window.addEventListener("load", async () => {
for (let infoEl of document.querySelectorAll("#info > div")) {
infoEl.onclick = () => clipboard.writeText(infoEl.innerText, 'selection');
}
});
};

async function downloadPhotoFromSmashgg() {
let smashggId = parseInt(document.getElementById('field-smashgg').value);
Expand Down
2 changes: 1 addition & 1 deletion scoreboard.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"id":"1YGtQJ2bpB77lv5i","teams":{"1":{"name":"test2","players":[{"_id":"","name":"test2","displayname":"","firstname":"","lastname":"","birthday":null,"pronoun":"","twitter":"","twitch":"","steam":"","slippicode":"","country":"","city":null,"team":[],"smashgg":3180370,"smashggIgnore":{},"lastActivity":null}],"characters":[],"state":0,"score":0,"selected":null,"out":[]},"2":{"name":"test1","players":[{"_id":"","name":"test1","displayname":"","firstname":"","lastname":"","birthday":null,"pronoun":"","twitter":"","twitch":"","steam":"","slippicode":"","country":"","city":null,"team":[],"smashgg":3180369,"smashggIgnore":{},"lastActivity":null}],"characters":[],"state":0,"score":0,"selected":null,"out":[]}},"caster":[{"_id":"07zHIqjsXuHPUqPS","name":"Blackoser","displayname":"","firstname":"Marvin","lastname":"M.","birthday":null,"pronoun":"","twitter":"","twitch":"therealblackoser","steam":"","slippicode":"","country":"wvKcVbVeCJRw7shL","city":"Hamburg","team":[],"smashgg":"959740","smashggIgnore":{"country":null},"lastActivity":"2022-12-18T15:35:11.278Z"},{"_id":"07zHIqjsXuHPUqPS","name":"Blackoser","displayname":"","firstname":"Marvin","lastname":"M.","birthday":null,"pronoun":"","twitter":"","twitch":"therealblackoser","steam":"","slippicode":"","country":"wvKcVbVeCJRw7shL","city":"Hamburg","team":[],"smashgg":"959740","smashggIgnore":{"country":null},"lastActivity":"2022-12-18T15:35:11.278Z"}],"seatorder":[[1,0],[2,0]],"ports":[],"fields":{"round":{"enabled":true,"value":"Winners Final"},"bo":{"value":"freeplay","enabled":true},"tournamentname":{"value":"Deleted","enabled":true},"location":{"value":"","enabled":true},"smashgg":{"value":"testslug","enabled":true},"countdown":{"value":"","enabled":false},"switchtostart":{"value":"","enabled":true},"switchtoend":{"value":"","enabled":true},"bottombar":{"value":"standing","enabled":true},"hashtag":{"value":"TestHashtag","enabled":true},"freetext":{"value":"","enabled":true}},"game":"SDQXva74lQfZPTes","startgg":{"set":55315656,"event":834071,"phaseGroup":1948508,"phase":1270965},"smashggtoken":"17975f78257ff3d9cbca6eab679d6777","streamlist":[{"id":55315656,"slots":[{"entrant":{"name":"test2"}},{"entrant":{"name":"test1"}}],"fullRoundText":"Winners Final","identifier":"A","round":1}],"type":null,"_D":"2023-05-21T14:55:35.485Z","showcaster":null,"smashgg":null,"all":null}
{"id":"1YGtQJ2bpB77lv5i","teams":{"1":{"name":"test2","players":[{"_id":"","name":"test2","displayname":"","firstname":"","lastname":"","birthday":null,"pronoun":"","twitter":"","twitch":"","steam":"","slippicode":"","country":"","city":null,"team":[],"smashgg":3180370,"smashggIgnore":{},"lastActivity":null}],"characters":[],"state":0,"score":0,"selected":null,"out":[]},"2":{"name":"test1","players":[{"_id":"AGjMiqQb0S3JaLUe","name":"3rd","displayname":"","firstname":"Jan","lastname":"K.","birthday":null,"pronoun":"he/him","twitter":"","twitch":"pepethebiggiraffe","steam":"","slippicode":"","country":"wvKcVbVeCJRw7shL","city":"Berlin","team":["DKHmmBRM3H80kiek"],"smashgg":"859325","smashggIgnore":{"country":null},"lastActivity":"2023-05-21T15:56:04.226Z"}],"characters":[],"state":0,"score":0,"selected":null,"out":[]}},"caster":[{"_id":"07zHIqjsXuHPUqPS","name":"Blackoser","displayname":"","firstname":"Marvin","lastname":"M.","birthday":null,"pronoun":"","twitter":"","twitch":"therealblackoser","steam":"","slippicode":"","country":"wvKcVbVeCJRw7shL","city":"Hamburg","team":[],"smashgg":"959740","smashggIgnore":{"country":null},"lastActivity":"2022-12-18T15:35:11.278Z"},{"_id":"07zHIqjsXuHPUqPS","name":"Blackoser","displayname":"","firstname":"Marvin","lastname":"M.","birthday":null,"pronoun":"","twitter":"","twitch":"therealblackoser","steam":"","slippicode":"","country":"wvKcVbVeCJRw7shL","city":"Hamburg","team":[],"smashgg":"959740","smashggIgnore":{"country":null},"lastActivity":"2022-12-18T15:35:11.278Z"}],"seatorder":[[1,0],[2,0]],"ports":[],"fields":{"round":{"enabled":true,"value":"Winners Final"},"bo":{"value":"freeplay","enabled":true},"tournamentname":{"value":"Deleted","enabled":true},"location":{"value":"","enabled":true},"smashgg":{"value":"testslug","enabled":true},"countdown":{"value":"","enabled":false},"switchtostart":{"value":"","enabled":true},"switchtoend":{"value":"","enabled":true},"bottombar":{"value":"standing","enabled":true},"hashtag":{"value":"TestHashtag","enabled":true},"freetext":{"value":"","enabled":true}},"game":"SDQXva74lQfZPTes","startgg":{"set":55315656,"event":834071,"phaseGroup":1948508,"phase":1270965},"smashggtoken":"17975f78257ff3d9cbca6eab679d6777","streamlist":[{"id":55315656,"slots":[{"entrant":{"name":"test2"}},{"entrant":{"name":"test1"}}],"fullRoundText":"Winners Final","identifier":"A","round":1}],"type":null,"_D":"2023-05-21T18:18:28.313Z","showcaster":null,"smashgg":null,"all":null}

0 comments on commit 1a136ee

Please sign in to comment.