Skip to content

Commit fee05aa

Browse files
committed
Improve the execution condition for the Todo refresh
1 parent 3a6f3be commit fee05aa

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
@@ -52,9 +52,31 @@ public ToDoExplorerViewModel(
5252
RefreshCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(),
5353
_ =>
5454
{
55-
_state.OnParseRequested(this);
55+
switch(_state.Status)
56+
{
57+
case ParserState.Ready:
58+
case ParserState.Error:
59+
case ParserState.ResolverError:
60+
case ParserState.UnexpectedError:
61+
case ParserState.Pending:
62+
_state.OnParseRequested(this);
63+
break;
64+
}
5665
},
57-
_ => _state.IsDirty());
66+
_ =>
67+
{
68+
switch (_state.Status)
69+
{
70+
case ParserState.Ready:
71+
case ParserState.Error:
72+
case ParserState.ResolverError:
73+
case ParserState.UnexpectedError:
74+
case ParserState.Pending:
75+
return true;
76+
default:
77+
return false;
78+
}
79+
});
5880
NavigateCommand = new NavigateCommand(selectionService);
5981
RemoveCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRemoveCommand, CanExecuteRemoveCommand);
6082
CollapseAllCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteCollapseAll);

0 commit comments

Comments
 (0)