Skip to content

Commit

Permalink
Improve reload stability
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernthedev committed Aug 19, 2024
1 parent 3ff418b commit c83d671
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class UserCSProjAction : BeatSaberProjectAction() {
withBackgroundProgress(project,"Create user.csproj" ) {
beatSaberProjectManager.locateFoldersAndGenerate(WorkspaceModel.getInstance(project).findProjects(), true)
}

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class ProjectUtils(
// }
ProjectModelViewUpdaterAsync.getInstance(project).requestUpdatePresentation()


val projectIds = projects.mapNotNull { it.getId(project) }


Expand All @@ -91,13 +92,14 @@ class ProjectUtils(

// ReloadProjectAction.execute() is the original code

yieldThroughInvokeLater()
while (project.solution.isLoading.valueOrNull == true) {
yieldThroughInvokeLater()
}

withContext(Dispatchers.EDT) {
// We do the same here sadly
val command2 =
ReloadCommand(projectIds.toList(), withDependencies = true, onlyUnloaded = false);

ReloadCommand(projectIds.toList(), withDependencies = false, onlyUnloaded = false);

project.solution.projectModelTasks.reloadProjects.runUnderProgress(
command2,
Expand Down

0 comments on commit c83d671

Please sign in to comment.