1.0.2
This commit is contained in:
parent
dede436d6f
commit
71fcada0a6
45
main.js
45
main.js
@ -35,17 +35,29 @@ async function createWindow() {
|
|||||||
|
|
||||||
await win.loadFile("templates/login/login.html")
|
await win.loadFile("templates/login/login.html")
|
||||||
|
|
||||||
/*const socket = io("ws://localhost:4000", {
|
var socket = null
|
||||||
autoConnect: false,
|
|
||||||
reconnection: false
|
|
||||||
|
|
||||||
});*/
|
if(process.env.DEV == "true") {
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const socket = io("ws://alpha.raphix.fr:4000", {
|
|
||||||
autoConnect: false,
|
|
||||||
reconnection: false
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
socket.connect()
|
socket.connect()
|
||||||
|
|
||||||
@ -110,6 +122,7 @@ async function createWindow() {
|
|||||||
|
|
||||||
socket.on("authFailed", () => {
|
socket.on("authFailed", () => {
|
||||||
win.webContents.send("discordFailed")
|
win.webContents.send("discordFailed")
|
||||||
|
win.restore()
|
||||||
log.client("Discord Auth : Erreur lors de la connexion vers Discord !")
|
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 !")
|
log.client("Discord Auth : Redirection fait avec succes !")
|
||||||
win.loadFile("templates/app/app.html")
|
win.loadFile("templates/app/app.html")
|
||||||
askUpdateState()
|
askUpdateState()
|
||||||
@ -144,7 +162,7 @@ async function createWindow() {
|
|||||||
|
|
||||||
socket.on("findResult", (data) => {
|
socket.on("findResult", (data) => {
|
||||||
|
|
||||||
log.client("Recherche : Terminé et récupéré")
|
log.client("Recherche : Termine et recupere")
|
||||||
win.webContents.send("findResult", data)
|
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.defaultApp) {
|
||||||
if (process.argv.length >= 2) {
|
if (process.argv.length >= 2) {
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "subsonics-manager",
|
"name": "subsonics-manager",
|
||||||
"version": "1.0.0",
|
"version": "1.0.2",
|
||||||
"description": "Manager for subsonics",
|
"description": "Manager for subsonics",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"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": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -43,6 +43,12 @@ ipc.on("connectSuccess", () => {
|
|||||||
ipc.on("discordFailed", () => {
|
ipc.on("discordFailed", () => {
|
||||||
|
|
||||||
discorSpan.innerHTML = '<button id="discord-connect" class="buttonTryAgain">Vérifier</button>'
|
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