-
-
Notifications
You must be signed in to change notification settings - Fork 385
doc(HikVision): update HikVision document #7337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -48,8 +48,11 @@ private async Task OnLogin() | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| private async Task OnLogout() | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| _analogChannels.Clear(); | ||||||||||||||||||||||
| _loginStatus = true; | ||||||||||||||||||||||
| _logoutStatus = true; | ||||||||||||||||||||||
| _startRealPlayStatus = true; | ||||||||||||||||||||||
| _stopRealPlayStatus = true; | ||||||||||||||||||||||
| await _hikVision.Logout(); | ||||||||||||||||||||||
|
Comment on lines
52
to
56
|
||||||||||||||||||||||
| _loginStatus = true; | |
| _logoutStatus = true; | |
| _startRealPlayStatus = true; | |
| _stopRealPlayStatus = true; | |
| await _hikVision.Logout(); | |
| await _hikVision.Logout(); | |
| _loginStatus = _hikVision.IsLogin; | |
| _logoutStatus = !_hikVision.IsLogin; | |
| _startRealPlayStatus = !_hikVision.IsLogin; | |
| _stopRealPlayStatus = !_hikVision.IsLogin; |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The login status is being set incorrectly. Setting _loginStatus = true will disable the login button (based on the pattern where true means disabled). After a successful login callback, the status should be set to false to indicate the user is logged in. Looking at OnInitedAsync (line 78), it sets _loginStatus = false after successful initialization, which is the correct pattern. This line should set _loginStatus = false instead of true.
| _loginStatus = true; | |
| _loginStatus = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): The logout handler sets
_loginStatustotrue, which seems semantically inverted for a logout operation.In
OnLogout, all status flags are set totrue, including_loginStatus. If_loginStatusrepresents "logged in", it should likely befalsehere, with the other flags derived from it (e.g.,_logoutStatus = !_loginStatus,_startRealPlayStatus = !_loginStatus). Iftrueinstead means something like "button enabled", consider renaming_loginStatusor otherwise clarifying this so it remains consistent withOnLoginAsync.