File tree 1 file changed +3
-15
lines changed
site/src/pages/WorkspacesPage 1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -130,30 +130,18 @@ function WorkspaceResultsRow({ template }: { template: Template }) {
130
130
export function WorkspacesButton ( ) {
131
131
const organizationId = useOrganizationId ( ) ;
132
132
const permissions = usePermissions ( ) ;
133
-
134
- const templatesQuery = useQuery ( {
135
- ...templates ( organizationId ) ,
136
-
137
- // Creating icons via the selector to guarantee icons array stays as stable
138
- // as possible, and only changes when the query produces new data
139
- select : ( templates ) => {
140
- return {
141
- list : templates ,
142
- icons : templates . map ( ( t ) => t . icon ) ,
143
- } ;
144
- } ,
145
- } ) ;
133
+ const templatesQuery = useQuery ( templates ( organizationId ) ) ;
146
134
147
135
// Dataset should always be small enough that client-side filtering should be
148
136
// good enough. Can swap out down the line if it becomes an issue
149
137
const [ searchTerm , setSearchTerm ] = useState ( "" ) ;
150
138
const processed = sortTemplatesByUsersDesc (
151
- templatesQuery . data ?. list ?? [ ] ,
139
+ templatesQuery . data ?? [ ] ,
152
140
searchTerm ,
153
141
) ;
154
142
155
143
let emptyState : ReactNode = undefined ;
156
- if ( templatesQuery . data ?. list . length === 0 ) {
144
+ if ( templatesQuery . data ?. length === 0 ) {
157
145
emptyState = (
158
146
< EmptyState
159
147
message = "No templates yet"
You can’t perform that action at this time.
0 commit comments