mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-28 01:25:32 +08:00
added generate pairing code catch
This commit is contained in:
parent
fae173c37a
commit
9e096e2590
1 changed files with 18 additions and 13 deletions
|
@ -527,19 +527,24 @@ $(
|
|||
".pageSettings .section.discordIntegration .buttons .generateCodeButton"
|
||||
).click((e) => {
|
||||
showBackgroundLoader();
|
||||
generatePairingCode({ uid: firebase.auth().currentUser.uid }).then((ret) => {
|
||||
hideBackgroundLoader();
|
||||
if (ret.data.status === 1 || ret.data.status === 2) {
|
||||
dbSnapshot.pairingCode = ret.data.pairingCode;
|
||||
$(".pageSettings .section.discordIntegration .code .bottom").text(
|
||||
ret.data.pairingCode
|
||||
);
|
||||
$(".pageSettings .section.discordIntegration .howtocode").text(
|
||||
ret.data.pairingCode
|
||||
);
|
||||
updateDiscordSettingsSection();
|
||||
}
|
||||
});
|
||||
generatePairingCode({ uid: firebase.auth().currentUser.uid })
|
||||
.then((ret) => {
|
||||
hideBackgroundLoader();
|
||||
if (ret.data.status === 1 || ret.data.status === 2) {
|
||||
dbSnapshot.pairingCode = ret.data.pairingCode;
|
||||
$(".pageSettings .section.discordIntegration .code .bottom").text(
|
||||
ret.data.pairingCode
|
||||
);
|
||||
$(".pageSettings .section.discordIntegration .howtocode").text(
|
||||
ret.data.pairingCode
|
||||
);
|
||||
updateDiscordSettingsSection();
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
hideBackgroundLoader();
|
||||
showNotification("Something went wrong. Error: " + e.message);
|
||||
});
|
||||
});
|
||||
|
||||
//funbox
|
||||
|
|
Loading…
Add table
Reference in a new issue