|
@@ -72,27 +72,30 @@ export function saveDiscordAuthWindowId (params) {
|
|
|
export function discordLoginCode({code}, sender) {
|
|
|
console.log('sender', sender)
|
|
|
let {windowId, id} = sender.tab || {};
|
|
|
-
|
|
|
- if(windowId) {
|
|
|
- chrome.windows.remove(
|
|
|
- windowId,
|
|
|
- function () {
|
|
|
-
|
|
|
- getDiscordUserInfo({
|
|
|
- authCode: code,
|
|
|
- redirectUrl: discordAuthRedirectUri
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 0) {
|
|
|
- setTimeout(() => {
|
|
|
- sendActivetabMessage({
|
|
|
- actionType: 'BACK_DISCORD_LOGIN_SUCCESS'
|
|
|
- });
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
+ chrome.tabs.remove(id);
|
|
|
+
|
|
|
+
|
|
|
+ getDiscordUserInfo({
|
|
|
+ authCode: code,
|
|
|
+ redirectUrl: discordAuthRedirectUri
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ setTimeout(() => {
|
|
|
+ sendActivetabMessage({
|
|
|
+ actionType: 'BACK_DISCORD_LOGIN_SUCCESS'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
export function twitterShortUrl(sender, url) {
|