1.0.2
This commit is contained in:
parent
dede436d6f
commit
71fcada0a6
47
main.js
47
main.js
@ -35,18 +35,30 @@ async function createWindow() {
|
||||
|
||||
await win.loadFile("templates/login/login.html")
|
||||
|
||||
/*const socket = io("ws://localhost:4000", {
|
||||
autoConnect: false,
|
||||
reconnection: false
|
||||
var socket = null
|
||||
|
||||
});*/
|
||||
if(process.env.DEV == "true") {
|
||||
|
||||
const socket = io("ws://alpha.raphix.fr:4000", {
|
||||
autoConnect: false,
|
||||
reconnection: false
|
||||
socket = io("ws://localhost:4000", {
|
||||
autoConnect: false,
|
||||
reconnection: false
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
log.client("DEVELOPMENT MODE --- QUIT IMMEDIATELY")
|
||||
|
||||
} else {
|
||||
socket = io("ws://alpha.raphix.fr:4000", {
|
||||
autoConnect: false,
|
||||
reconnection: false
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
socket.connect()
|
||||
|
||||
|
||||
@ -110,6 +122,7 @@ async function createWindow() {
|
||||
|
||||
socket.on("authFailed", () => {
|
||||
win.webContents.send("discordFailed")
|
||||
win.restore()
|
||||
log.client("Discord Auth : Erreur lors de la connexion vers Discord !")
|
||||
})
|
||||
|
||||
@ -119,7 +132,12 @@ async function createWindow() {
|
||||
|
||||
})
|
||||
|
||||
socket.on("successLogin", () => {
|
||||
socket.on("successLogin", (token) => {
|
||||
const settings = {}
|
||||
settings["token"] = token
|
||||
|
||||
fs.writeFileSync( __dirname + path.sep + "settings.json", JSON.stringify(settings, null, 2))
|
||||
log.client("Saving token in settings !")
|
||||
log.client("Discord Auth : Redirection fait avec succes !")
|
||||
win.loadFile("templates/app/app.html")
|
||||
askUpdateState()
|
||||
@ -144,7 +162,7 @@ async function createWindow() {
|
||||
|
||||
socket.on("findResult", (data) => {
|
||||
|
||||
log.client("Recherche : Terminé et récupéré")
|
||||
log.client("Recherche : Termine et recupere")
|
||||
win.webContents.send("findResult", data)
|
||||
})
|
||||
|
||||
@ -219,14 +237,7 @@ async function createWindow() {
|
||||
|
||||
})
|
||||
|
||||
socket.on("registerToken", (token) => {
|
||||
|
||||
const settings = {}
|
||||
settings["token"] = token
|
||||
|
||||
fs.writeFileSync( __dirname + path.sep + "settings.json", JSON.stringify(settings, null, 2))
|
||||
log.client("Saving token in settings !")
|
||||
})
|
||||
|
||||
|
||||
if (process.defaultApp) {
|
||||
if (process.argv.length >= 2) {
|
||||
|
@ -1,10 +1,12 @@
|
||||
{
|
||||
"name": "subsonics-manager",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.2",
|
||||
"description": "Manager for subsonics",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"start": "electron ."
|
||||
"start": "electron .",
|
||||
"dev": "set DEV=true& electron .",
|
||||
"build": "electron-packager . submanager-1.0.0 --platform='win32' --out='C:\\Users\\picot\\OneDrive\\Bureau\\Developement\\SubSonics BOT\\manager\\dist' --overwrite"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -43,6 +43,12 @@ ipc.on("connectSuccess", () => {
|
||||
ipc.on("discordFailed", () => {
|
||||
|
||||
discorSpan.innerHTML = '<button id="discord-connect" class="buttonTryAgain">Vérifier</button>'
|
||||
const reDiscord = document.getElementById("discord-connect")
|
||||
reDiscord.addEventListener("click", () => {
|
||||
|
||||
discorSpan.innerHTML = '<img style="width: 5%; height: 5%;" class="loading" src="../common/spinner-third-svgrepo-com.svg">'
|
||||
ipc.send("discordlogin")
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user