Skip to content

Commit

Permalink
Don't show background item notification when launch daemon is not sup…
Browse files Browse the repository at this point in the history
…ported
  • Loading branch information
ravicious committed Aug 1, 2024
1 parent 15187ea commit 51caae9
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 39 deletions.
80 changes: 43 additions & 37 deletions gen/proto/go/teleport/lib/teleterm/vnet/v1/vnet_service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/teleterm/vnet/service_daemon_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ func backgroundItemStatusFromServiceStatus(status vnetdaemon.ServiceStatus) api.
return api.BackgroundItemStatus_BACKGROUND_ITEM_STATUS_REQUIRES_APPROVAL
case vnetdaemon.ServiceStatusNotFound:
return api.BackgroundItemStatus_BACKGROUND_ITEM_STATUS_NOT_FOUND
case vnetdaemon.ServiceStatusNotSupported:
return api.BackgroundItemStatus_BACKGROUND_ITEM_STATUS_NOT_SUPPORTED
default:
return api.BackgroundItemStatus_BACKGROUND_ITEM_STATUS_UNSPECIFIED
}
Expand Down
4 changes: 4 additions & 0 deletions lib/vnet/daemon/client_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ const (
ServiceStatusEnabled ServiceStatus = 1
ServiceStatusRequiresApproval ServiceStatus = 2
ServiceStatusNotFound ServiceStatus = 3
// ServiceStatusNotSupported is returned by us when macOS version is < 13.0.
ServiceStatusNotSupported ServiceStatus = -1
)

func (s ServiceStatus) String() string {
Expand All @@ -212,6 +214,8 @@ func (s ServiceStatus) String() string {
return "requires approval"
case ServiceStatusNotFound:
return "not found"
case ServiceStatusNotSupported:
return "not supported"
default:
return strconv.Itoa(int(s))
}
Expand Down
1 change: 1 addition & 0 deletions proto/teleport/lib/teleterm/vnet/v1/vnet_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ enum BackgroundItemStatus {
BACKGROUND_ITEM_STATUS_ENABLED = 2;
BACKGROUND_ITEM_STATUS_REQUIRES_APPROVAL = 3;
BACKGROUND_ITEM_STATUS_NOT_FOUND = 4;
BACKGROUND_ITEM_STATUS_NOT_SUPPORTED = 5;
}
6 changes: 5 additions & 1 deletion web/packages/teleterm/src/ui/Vnet/vnetContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ const notifyAboutDaemonBackgroundItem = async (ctx: IAppContext) => {
throw error;
}

if (backgroundItemStatus === BackgroundItemStatus.ENABLED) {
if (
backgroundItemStatus === BackgroundItemStatus.ENABLED ||
backgroundItemStatus === BackgroundItemStatus.NOT_SUPPORTED ||
backgroundItemStatus === BackgroundItemStatus.UNSPECIFIED
) {
return;
}

Expand Down

0 comments on commit 51caae9

Please sign in to comment.