@@ -163,10 +163,6 @@ export default function CreateAppGroup({
163163 ? _unauthorizedAppList . push ( { id : app . id , appName : app . appName } )
164164 : _authorizedAppList . push ( { id : app . id , appName : app . appName } )
165165 } )
166- _unauthorizedAppList . filter (
167- ( app ) =>
168- selectedAppsMap [ app . id ] && ( ! selectedAppSearchText || app . appName . indexOf ( selectedAppSearchText ) >= 0 ) ,
169- )
170166 setUnauthorizedAppList ( _unauthorizedAppList )
171167 setAuthorizedAppList ( _authorizedAppList )
172168 }
@@ -187,6 +183,10 @@ export default function CreateAppGroup({
187183 ( app ) =>
188184 selectedAppsMap [ app . id ] && ( ! selectedAppSearchText || app . appName . indexOf ( selectedAppSearchText ) >= 0 ) ,
189185 )
186+ const filteredUnAuthList = unauthorizedAppList . filter (
187+ ( app ) =>
188+ selectedAppsMap [ app . id ] && ( ! selectedAppSearchText || app . appName . indexOf ( selectedAppSearchText ) >= 0 ) ,
189+ )
190190 return (
191191 < div >
192192 < SearchBar
@@ -197,7 +197,7 @@ export default function CreateAppGroup({
197197 setSearchApplied = { setSelectedAppSearchApplied }
198198 />
199199 < div >
200- { filteredAuthList . length <= 0
200+ { filteredAuthList . length <= 0 && filteredUnAuthList . length <= 0
201201 ? renderEmptyState ( 'No matching results' )
202202 : filteredAuthList . map ( ( app ) => {
203203 return (
@@ -213,12 +213,12 @@ export default function CreateAppGroup({
213213 </ div >
214214 )
215215 } ) }
216- { unauthorizedAppList . length > 0 && (
216+ { filteredUnAuthList . length > 0 && (
217217 < div className = "dc__bold ml-4" >
218218 { `You don't have admin/manager pemission for the following ${ filterParentTypeMsg } .` }
219219 </ div >
220220 ) }
221- { unauthorizedAppList . map ( ( app ) => {
221+ { filteredUnAuthList . map ( ( app ) => {
222222 return (
223223 < Tippy
224224 key = { `selected-app-${ app . id } ` }
0 commit comments