diff --git a/Assets/Scripts/InteractionEngine/FactHandling/Facts/Fact.cs b/Assets/Scripts/InteractionEngine/FactHandling/Facts/Fact.cs index 84fcffdb3a05dcc102ff767666c4cdafc42ccc63..ad15c40e8982f38e46780cdb92437807b9681dcd 100644 --- a/Assets/Scripts/InteractionEngine/FactHandling/Facts/Fact.cs +++ b/Assets/Scripts/InteractionEngine/FactHandling/Facts/Fact.cs @@ -480,7 +480,8 @@ static string _SendAdd(string path, string body)//, Action<string> uriCallback) UnityWebRequestAsyncOperation web = www.SendWebRequest(); - while (!web.isDone) ; + while (!web.isDone // not enough as querry + && www.result == UnityWebRequest.Result.InProgress) ; if (www.result == UnityWebRequest.Result.ConnectionError || www.result == UnityWebRequest.Result.ProtocolError) @@ -489,20 +490,18 @@ static string _SendAdd(string path, string body)//, Action<string> uriCallback) //uriCallback(null); return null; // yield break; } - else - { - while (!www.downloadHandler.isDone) - //yield return null - ; - FactReference res = JsonUtility.FromJson<FactReference>(www.downloadHandler.text); + while (!www.downloadHandler.isDone) + //yield return null + ; - if (CommunicationEvents.VerboseURI) - Debug.Log("Server added Fact:\n" + res.uri); + FactReference res = JsonUtility.FromJson<FactReference>(www.downloadHandler.text); - //uriCallback(res.uri); - return res.uri; // yield break; - } + if (CommunicationEvents.VerboseURI) + Debug.Log("Server added Fact:\n" + res.uri); + + //uriCallback(res.uri); + return res.uri; // yield break; } }