mirror of
				https://github.com/monkeytypegame/monkeytype.git
				synced 2025-11-04 09:06:17 +08:00 
			
		
		
		
	updating as soon as response is received
This commit is contained in:
		
							parent
							
								
									48679e0cc2
								
							
						
					
					
						commit
						f202f5c5d4
					
				
					 2 changed files with 9 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -3,6 +3,7 @@ import * as Notifications from "../elements/notifications";
 | 
			
		|||
import * as Settings from "../pages/settings";
 | 
			
		||||
import * as DB from "../db";
 | 
			
		||||
import * as Loader from "../elements/loader";
 | 
			
		||||
import * as AccountButton from "../elements/account-button";
 | 
			
		||||
 | 
			
		||||
interface Data {
 | 
			
		||||
  accessToken: string;
 | 
			
		||||
| 
						 | 
				
			
			@ -41,5 +42,7 @@ export async function verify(): Promise<void> {
 | 
			
		|||
 | 
			
		||||
  DB.setSnapshot(snapshot);
 | 
			
		||||
 | 
			
		||||
  AccountButton.update(discordId, discordAvatar);
 | 
			
		||||
 | 
			
		||||
  Settings.updateDiscordSection();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,6 +10,7 @@ import * as ThemePicker from "../settings/theme-picker";
 | 
			
		|||
import * as CustomText from "../test/custom-text";
 | 
			
		||||
import * as CustomTextPopup from "../popups/custom-text-popup";
 | 
			
		||||
import * as SavedTextsPopup from "./saved-texts-popup";
 | 
			
		||||
import * as AccountButton from "../elements/account-button";
 | 
			
		||||
import { FirebaseError } from "firebase/app";
 | 
			
		||||
import { Auth } from "../firebase";
 | 
			
		||||
import {
 | 
			
		||||
| 
						 | 
				
			
			@ -857,7 +858,11 @@ list["unlinkDiscord"] = new SimplePopup(
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    Notifications.add("Accounts unlinked", 1);
 | 
			
		||||
    DB.getSnapshot().discordId = undefined;
 | 
			
		||||
    const snap = DB.getSnapshot();
 | 
			
		||||
    snap.discordAvatar = undefined;
 | 
			
		||||
    snap.discordId = undefined;
 | 
			
		||||
    AccountButton.update();
 | 
			
		||||
    DB.setSnapshot(snap);
 | 
			
		||||
    Settings.updateDiscordSection();
 | 
			
		||||
  },
 | 
			
		||||
  () => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue