Skip to content
Permalink
Browse files

discord unlink

  • Loading branch information...
Manuel-777 committed Jun 17, 2019
1 parent 39c59e5 commit 8411f9fa672c7b63e5e3a4b27c54ba544182ad3f
Showing with 31 additions and 2 deletions.
  1. +5 −0 window_background/background.js
  2. +18 −1 window_background/http-api.js
  3. +8 −1 window_main/home.js
@@ -285,6 +285,11 @@ ipc.on("login", function(event, arg) {
}
});

//
ipc.on("unlink_discord", function(event, obj) {
httpApi.httpDiscordUnlink();
});

//
ipc.on("request_draft_link", function(event, obj) {
httpApi.httpDraftShareLink(obj.id, obj.expire);
@@ -6,7 +6,6 @@ global
db
pd
debugNet
store
debugLog
syncUserData
*/
@@ -163,6 +162,14 @@ function httpBasic() {
});
}

if (_headers.method == "discord_unlink") {
ipc_send("popup", {
text: "Unlink Ok",
time: 1000,
progress: -1
});
ipc_send("set_discord_tag", "");
}
if (_headers.method == "notifications") {
notificationProcess(parsedResult);
}
@@ -635,9 +642,19 @@ function httpSyncRequest(data) {
});
}

function httpDiscordUnlink() {
var _id = makeId(6);
httpAsync.unshift({
reqId: _id,
method: "discord_unlink",
method_path: "/api/discord_unlink.php"
});
}

module.exports = {
httpAuth,
httpBasic,
httpDiscordUnlink,
httpSubmitCourse,
httpSetPlayer,
httpGetExplore,
@@ -88,7 +88,7 @@ function openHomeTab(arg, opentab = true) {
mainDiv.appendChild(title);
let cont = createDivision(["tournament_list_cont"]);

if (ls.discordTag === null) {
if (ls.discordTag === null || ls.discordTag == "") {
let but = createDivision(["discord_but"]);
but.addEventListener("click", () => {
let url =
@@ -108,6 +108,13 @@ function openHomeTab(arg, opentab = true) {
fl.style.width = "fit-content";
mainDiv.appendChild(fl);

let unlinkBut = createDivision(["button_simple", "centered"], "Unlink");
mainDiv.appendChild(unlinkBut);

unlinkBut.addEventListener("click", () => {
ipcSend("unlink_discord", true);
});

clearHomeInverals();
listInterval = [];
if (tournaments_list) {

0 comments on commit 8411f9f

Please sign in to comment.
You can’t perform that action at this time.