Git plugin fixes

This commit is contained in:
Martín Lucas Golini
2024-01-22 23:54:34 -03:00
parent d8f97e7258
commit a11b6ef9c5
2 changed files with 5 additions and 3 deletions

View File

@@ -1275,8 +1275,9 @@ void GitPlugin::runAsync( std::function<Git::Result()> fn, bool _updateStatus,
if ( !mGit )
return;
mLoader->setVisible( true );
mThreadPool->run( [&] {
mThreadPool->run( [this, fn, _updateStatus, _updateBranches] {
auto res = fn();
getUISceneNode()->runOnMainThread( [this] { mLoader->setVisible( false ); } );
if ( res.fail() ) {
showMessage( LSPMessageType::Warning, res.result );
return;
@@ -1285,7 +1286,6 @@ void GitPlugin::runAsync( std::function<Git::Result()> fn, bool _updateStatus,
updateBranches();
if ( _updateStatus )
updateStatus( true );
getUISceneNode()->runOnMainThread( [this] { mLoader->setVisible( false ); } );
} );
}