Skip to content

Commit 327109b

Browse files
authored
Merge pull request #4940 from bclothier/HotFixTodoRefreshPrematurely
Improves the execution condition for the ToDo Explorer refresh
2 parents 390c5df + fee05aa commit 327109b

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

Rubberduck.Core/UI/ToDoItems/ToDoExplorerViewModel.cs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,31 @@ public ToDoExplorerViewModel(
5353
RefreshCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(),
5454
_ =>
5555
{
56-
_state.OnParseRequested(this);
56+
switch(_state.Status)
57+
{
58+
case ParserState.Ready:
59+
case ParserState.Error:
60+
case ParserState.ResolverError:
61+
case ParserState.UnexpectedError:
62+
case ParserState.Pending:
63+
_state.OnParseRequested(this);
64+
break;
65+
}
5766
},
58-
_ => _state.IsDirty());
67+
_ =>
68+
{
69+
switch (_state.Status)
70+
{
71+
case ParserState.Ready:
72+
case ParserState.Error:
73+
case ParserState.ResolverError:
74+
case ParserState.UnexpectedError:
75+
case ParserState.Pending:
76+
return true;
77+
default:
78+
return false;
79+
}
80+
});
5981
NavigateCommand = new NavigateCommand(selectionService);
6082
RemoveCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRemoveCommand, CanExecuteRemoveCommand);
6183
CollapseAllCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteCollapseAll);

0 commit comments

Comments
 (0)