Skip to content

Commit b4bc684

Browse files
committed
Fix pooling
1 parent 58d6a6a commit b4bc684

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

site/src/components/GlobalSnackbar/GlobalSnackbar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export const GlobalSnackbar: React.FC = () => {
7272

7373
return (
7474
<EnterpriseSnackbar
75+
key={notification.msg}
7576
open={open}
7677
variant={variantFromMsgType(notification.msgType)}
7778
message={

site/src/xServices/workspaces/workspacesXService.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ export const workspaceItemMachine = createMachine(
3333
startWorkspace: {
3434
data: TypesGen.WorkspaceBuild
3535
}
36+
getWorkspace: {
37+
data: TypesGen.Workspace
38+
}
3639
},
3740
},
3841
tsTypes: {} as import("./workspacesXService.typegen").Typegen0,
@@ -93,10 +96,11 @@ export const workspaceItemMachine = createMachine(
9396
{
9497
target: "waitingToBeUpdated",
9598
cond: "isOutdated",
99+
actions: ["assignUpdatedData"],
96100
},
97101
{
98102
target: "success",
99-
actions: "displayUpdatedSuccessMessage",
103+
actions: ["assignUpdatedData", "displayUpdatedSuccessMessage"],
100104
},
101105
],
102106
},
@@ -113,7 +117,7 @@ export const workspaceItemMachine = createMachine(
113117
},
114118
{
115119
guards: {
116-
isOutdated: (ctx) => !ctx.data.outdated,
120+
isOutdated: (_, event) => event.data.outdated,
117121
},
118122
services: {
119123
getTemplate: (context) => API.getTemplate(context.data.template_id),
@@ -124,6 +128,7 @@ export const workspaceItemMachine = createMachine(
124128

125129
return API.startWorkspace(context.data.id, context.updatedTemplate.active_version_id)
126130
},
131+
getWorkspace: (context) => API.getWorkspace(context.data.id),
127132
},
128133
actions: {
129134
assignUpdatedTemplate: assign({
@@ -142,7 +147,7 @@ export const workspaceItemMachine = createMachine(
142147
displayError(message)
143148
},
144149
displayUpdatingVersionMessage: () => {
145-
displayMsg("Updating your workspace", "It will be running in a few seconds.")
150+
displayMsg("Updating workspace...")
146151
},
147152
assignQueuedStatus: assign({
148153
data: (ctx) => {
@@ -161,6 +166,9 @@ export const workspaceItemMachine = createMachine(
161166
displayUpdatedSuccessMessage: () => {
162167
displaySuccess("Workspace updated successfully.")
163168
},
169+
assignUpdatedData: assign({
170+
data: (_, event) => event.data,
171+
}),
164172
},
165173
},
166174
)

0 commit comments

Comments
 (0)