Skip to content

Commit 8edd955

Browse files
committed
code_review: PR #956
* Just use `Check` instead of a new one `AutoCheck` Signed-off-by: leo <[email protected]>
1 parent 2105fd4 commit 8edd955

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/ViewModels/LauncherPage.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,15 @@ public bool CanCreatePopup()
5959
public void StartPopup(Popup popup)
6060
{
6161
Popup = popup;
62-
ProcessPopup(true);
62+
ProcessPopup();
6363
}
6464

65-
public async void ProcessPopup(bool autoCheck = false)
65+
public async void ProcessPopup()
6666
{
6767
if (_popup != null)
6868
{
6969
if (!_popup.Check())
7070
return;
71-
if (autoCheck && !_popup.AutoCheck())
72-
return;
7371

7472
_popup.InProgress = true;
7573
var task = _popup.Sure();

src/ViewModels/Popup.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,14 @@ public string ProgressDescription
2929
}
3030

3131
[UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode")]
32-
public bool Check()
32+
public virtual bool Check()
3333
{
3434
if (HasErrors)
3535
return false;
3636
ValidateAllProperties();
3737
return !HasErrors;
3838
}
3939

40-
public virtual bool AutoCheck()
41-
{
42-
return true;
43-
}
44-
4540
public virtual Task<bool> Sure()
4641
{
4742
return null;

src/ViewModels/Push.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ public Push(Repository repo, Models.Branch localBranch)
152152
View = new Views.Push() { DataContext = this };
153153
}
154154

155-
public override bool AutoCheck()
155+
public override bool Check()
156156
{
157-
return !string.IsNullOrEmpty(_selectedRemoteBranch?.Head);
157+
return base.Check() && !string.IsNullOrEmpty(_selectedRemoteBranch?.Head);
158158
}
159159

160160
public override Task<bool> Sure()

0 commit comments

Comments
 (0)