Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add connect/disconnect notifications on Coder Connect#140

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ibetitsmike merged 7 commits intomainfrommike/40-connect-notification
Jul 1, 2025

Conversation

ibetitsmike
Copy link
Contributor

Fixes:#40

Comment on lines +342 to +343
var app = (App)Current;
if (app != null && app.TrayWindow != null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Shouldn't this just beif (TrayWindow != null) TrayWindow.Tray_Open();?


private ConcurrentDictionary<string, INotificationHandler> Handlers { get; } = new();

public UserNotifier(ILogger<UserNotifier> logger, IDispatcherQueueManager dispatcherQueueManager,
INotificationHandler notificationHandler)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Perhaps we should wrap it with a marker type likepublic interface IDefaultNotificationHandler : INotificationHandler so we don't inadvertently add another implementation that could get DI'd here, and only have theApp implementIDefaultNotificationHandler

Comment on lines +157 to +166
// This method is called when the state changes, but we don't want to notify
// the user if the state hasn't changed.
var isRpcLifecycleChanged = rpcModel.RpcLifecycle == RpcLifecycle.Disconnected && curRpcLifecycle != rpcModel.RpcLifecycle;
var isVpnLifecycleChanged = (rpcModel.VpnLifecycle == VpnLifecycle.Started || rpcModel.VpnLifecycle == VpnLifecycle.Stopped) && curVpnLifecycle != rpcModel.VpnLifecycle;

if (!isRpcLifecycleChanged && !isVpnLifecycleChanged)
{
return;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think you need any of these lines since they're essentially covered by what's below right?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Unfortunately no, I ignore the intermediate states of the Vpn lifecycle on purpose (and I don't update the prevRpcLifecycle for that reason).

@ibetitsmikeibetitsmike merged commit7e3782f intomainJul 1, 2025
3 checks passed
@ibetitsmikeibetitsmike deleted the mike/40-connect-notification branchJuly 1, 2025 17:09
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@deansheatherdeansheatherdeansheather approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

VPN/RPC state changes should send the user a notification
2 participants
@ibetitsmike@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp