Browse Source

UI: Create/Delete YouTube Dock when switching profiles

derrod 2 years ago
parent
commit
eb89f7c3ab
1 changed files with 12 additions and 0 deletions
  1. 12 0
      UI/window-basic-main-profiles.cpp

+ 12 - 0
UI/window-basic-main-profiles.cpp

@@ -317,6 +317,10 @@ bool OBSBasic::CreateProfile(const std::string &newName, bool create_new,
 	if (create_new) {
 	if (create_new) {
 		auth.reset();
 		auth.reset();
 		DestroyPanelCookieManager();
 		DestroyPanelCookieManager();
+#ifdef YOUTUBE_ENABLED
+		if (youtubeAppDock)
+			DeleteYouTubeAppDock();
+#endif
 	} else if (!rename) {
 	} else if (!rename) {
 		DuplicateCurrentCookieProfile(config);
 		DuplicateCurrentCookieProfile(config);
 	}
 	}
@@ -782,6 +786,10 @@ void OBSBasic::ChangeProfile()
 	Auth::Save();
 	Auth::Save();
 	auth.reset();
 	auth.reset();
 	DestroyPanelCookieManager();
 	DestroyPanelCookieManager();
+#ifdef YOUTUBE_ENABLED
+	if (youtubeAppDock)
+		DeleteYouTubeAppDock();
+#endif
 
 
 	config.Swap(basicConfig);
 	config.Swap(basicConfig);
 	InitBasicConfigDefaults();
 	InitBasicConfigDefaults();
@@ -793,6 +801,10 @@ void OBSBasic::ChangeProfile()
 	UpdateVolumeControlsDecayRate();
 	UpdateVolumeControlsDecayRate();
 
 
 	Auth::Load();
 	Auth::Load();
+#ifdef YOUTUBE_ENABLED
+	if (YouTubeAppDock::IsYTServiceSelected() && !youtubeAppDock)
+		NewYouTubeAppDock();
+#endif
 
 
 	CheckForSimpleModeX264Fallback();
 	CheckForSimpleModeX264Fallback();