Commit 76b27192 authored by Nathan Chambron's avatar Nathan Chambron
Browse files

fix: remove graph when selecting unreachable server

parent 4dc8413b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -47,10 +47,14 @@ namespace Assets.ETSI.ARF.ARF_World_Storage_API.Editor.Windows
        public static void ShowWindowFromWorldStorageWindow(WorldStorageServer server, WorldStorageUser user)
        {
            var window = GetWindow<WorldGraphWindow>("Graph Editor", true, typeof(SceneView));
            if (window.myGraph != null && window.myGraph.ServerAndLocalDifferent() && EditorUtility.DisplayDialog("Saving node positions", "The World Graph has been modified. \nWould you like to push the modifications to the server ?", "Yes", "No"))
            if (window.myGraph != null)
            {
                if (window.myGraph.ServerAndLocalDifferent() && EditorUtility.DisplayDialog("Saving node positions", "The World Graph has been modified. \nWould you like to push the modifications to the server ?", "Yes", "No"))
                {
                    window.myGraph.SaveInServer();
                }
                window.rootVisualElement.Remove(window.myGraph);
            }
            GraphEditorWindow.ResetWindow();
            window.worldStorageServer = server;
            window.worldStorageUser = user;