mirror of
https://github.com/coder/coder.git
synced 2026-10-16 14:48:56 +08:00
fix: resolve TypeScript errors for os field on connection logs
- Add optional chaining for userAgent.os.name in ConnectionLogRow.tsx - Make os field optional in DiagnosticSessionConnection type to match Go SDK
This commit is contained in:
@@ -110,7 +110,7 @@ export const ConnectionLogRow: FC<ConnectionLogRowProps> = ({
|
||||
{(connectionLog.os || userAgent?.os.name) && (
|
||||
<div>
|
||||
<h4 css={styles.connectionLogInfoheader}>OS:</h4>
|
||||
<div>{connectionLog.os || userAgent.os.name}</div>
|
||||
<div>{connectionLog.os || userAgent?.os?.name}</div>
|
||||
</div>
|
||||
)}
|
||||
{userAgent?.browser.name && (
|
||||
|
||||
@@ -115,7 +115,7 @@ export interface DiagnosticSessionConnection {
|
||||
disconnected_at: string | null;
|
||||
status: WorkspaceConnectionStatus;
|
||||
exit_code: number | null;
|
||||
os: string;
|
||||
os?: string;
|
||||
explanation: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user