Skip to content

Commit 1b6840d

Browse files
committed
Add readonly to workspace arrays
This was a change in coder/coder.
1 parent 05a6808 commit 1b6840d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/api-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function errToStr(error: unknown, def: string) {
1111
return def
1212
}
1313

14-
export function extractAllAgents(workspaces: Workspace[]): WorkspaceAgent[] {
14+
export function extractAllAgents(workspaces: readonly Workspace[]): WorkspaceAgent[] {
1515
return workspaces.reduce((acc, workspace) => {
1616
return acc.concat(extractAgents(workspace))
1717
}, [] as WorkspaceAgent[])

src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export class Commands {
238238
quickPick.value = "owner:me "
239239
quickPick.placeholder = "owner:me template:go"
240240
quickPick.title = `Connect to a workspace`
241-
let lastWorkspaces: Workspace[]
241+
let lastWorkspaces: readonly Workspace[]
242242
quickPick.onDidChangeValue((value) => {
243243
quickPick.busy = true
244244
getWorkspaces({

src/workspaceAction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ export class WorkspaceAction {
2121
#POLL_INTERVAL: number = 1000 * 5
2222
#fetchWorkspacesInterval?: ReturnType<typeof setInterval>
2323

24-
#ownedWorkspaces: Workspace[] = []
24+
#ownedWorkspaces: readonly Workspace[] = []
2525
#workspacesApproachingAutostop: NotifiedWorkspace[] = []
2626
#workspacesApproachingDeletion: NotifiedWorkspace[] = []
2727

2828
private constructor(
2929
private readonly vscodeProposed: typeof vscode,
3030
private readonly storage: Storage,
31-
ownedWorkspaces: Workspace[],
31+
ownedWorkspaces: readonly Workspace[],
3232
) {
3333
this.#ownedWorkspaces = ownedWorkspaces
3434

0 commit comments

Comments
 (0)