Permalink
Browse files

Fix so the system request with operate on the UI Thread

  • Loading branch information...
1 parent f964f18 commit 9536e6151f870b9817ceb4fb6d05e032e9cdc45a @DanielDar DanielDar committed Mar 18, 2013
Showing with 18 additions and 11 deletions.
  1. +8 −5 Raven.Studio/Infrastructure/Model.cs
  2. +10 −6 Raven.Studio/Models/ServerModel.cs
@@ -39,12 +39,15 @@ internal void TimerTicked()
{
if (task.IsFaulted == false)
{
- if (task.Result != null && task.Result.DataAsJson.ContainsKey("WarnWhenUsingSystemDatabase"))
+ Execute.OnTheUI(() =>
{
- if (task.Result.DataAsJson.Value<bool>("WarnWhenUsingSystemDatabase") == false)
- return;
- }
- Command.ExecuteCommand(new CreateDatabaseCommand());
+ if (task.Result != null && task.Result.DataAsJson.ContainsKey("WarnWhenUsingSystemDatabase"))
+ {
+ if (task.Result.DataAsJson.Value<bool>("WarnWhenUsingSystemDatabase") == false)
+ return;
+ }
+ Command.ExecuteCommand(new CreateDatabaseCommand());
+ });
}
else
{
@@ -136,13 +136,17 @@ public override Task TimerTickedAsync()
{
if (task.IsFaulted == false)
{
- if (task.Result != null &&
- task.Result.DataAsJson.ContainsKey("WarnWhenUsingSystemDatabase"))
+ Execute.OnTheUI(() =>
{
- if (task.Result.DataAsJson.Value<bool>("WarnWhenUsingSystemDatabase") ==
- false)
- UrlUtil.Navigate("/documents");
- }
+ if (task.Result != null &&
+ task.Result.DataAsJson.ContainsKey("WarnWhenUsingSystemDatabase"))
+ {
+ if (task.Result.DataAsJson.Value<bool>("WarnWhenUsingSystemDatabase") ==
+ false)
+ UrlUtil.Navigate("/documents");
+ }
+ });
+
}
else
{

0 comments on commit 9536e61

Please sign in to comment.