Skip to content

Commit

Permalink
Fixed Spotify process running dialog popup even if Spotify is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dasutein committed May 2, 2019
1 parent d913e57 commit 0a9f32c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/DiscordRPC.Main/GetSpotifyProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ public void SpotifyProcess()
try
{

if (!isSpotifyOpened)
{
MessageBox.Show("Discord RPC has detected Spotify is running. Your rich presence or Spotify presence will not update until your RPC client or Spotify client is offline.", Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyTitleAttribute>().Title, MessageBoxButton.OK, MessageBoxImage.Exclamation);
}

while (true)
{
Process[] spotifyProcess = Process.GetProcessesByName("Spotify");
Expand All @@ -52,6 +47,11 @@ public void SpotifyProcess()

Thread.Sleep(1500);
}

if (!isSpotifyOpened)
{
MessageBox.Show("Discord RPC has detected Spotify is running. Your rich presence or Spotify presence will not update until your RPC client or Spotify client is offline.", Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyTitleAttribute>().Title, MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
}
catch (ThreadAbortException ate)
{
Expand Down

0 comments on commit 0a9f32c

Please sign in to comment.