Skip to content

Commit

Permalink
Merge pull request #147 from scenario-labs/146-if-someone-has-no-imag…
Browse files Browse the repository at this point in the history
…es-on-their-account-the-images-window-should-not-display-loading-images-indefinitly

fix!: refresh images window
  • Loading branch information
Morgan-6Freedom authored Mar 5, 2024
2 parents df15eba + 61520ab commit 6774954
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 11 additions & 6 deletions package/Editor/Images/Images.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public class Images : EditorWindow
[MenuItem("Window/Scenario/Images")]
public static void ShowWindow()
{
if (isVisible)
return;

lastPageToken = string.Empty;
imageDataList.Clear();
if (!isVisible)
{
lastPageToken = string.Empty;
imageDataList.Clear();
}
GetInferencesData();

var images = (Images)GetWindow(typeof(Images));
Expand All @@ -38,7 +38,12 @@ private void OnGUI()
{
ImagesUI.OnGUI(this.position);
}


private void OnEnable()
{
ShowWindow();
}

private void OnDestroy()
{
ImagesUI.OnClose();
Expand Down
2 changes: 2 additions & 0 deletions package/Editor/_Services/PromptFetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ private static async void GetInferenceStatus(string inferenceId, string modelId)
inferenceStatusRoot.inference.createdAt,
img.Seed);
}

Images.ShowWindow();
}
});
}
Expand Down

0 comments on commit 6774954

Please sign in to comment.