@@ -91,6 +91,12 @@ const sfc = {
9191 }${this .privateFilter === ' private' ? ' &is_private=true' : ' ' }${this .privateFilter === ' public' ? ' &is_private=false' : ' '
9292 } ` ;
9393 },
94+ isRepoEmpty() {
95+ return ! this .isLoading && ! this .reposTotalCount ;
96+ },
97+ isOrgEmpty() {
98+ return ! this .isLoading && ! this .organizations .length ;
99+ },
94100 repoTypeCount() {
95101 return this .counts [` ${this .reposFilter }:${this .archivedFilter }:${this .privateFilter } ` ];
96102 },
@@ -243,7 +249,7 @@ const sfc = {
243249 if (! this .reposTotalCount ) {
244250 const totalCountSearchURL = ` ${this .subUrl }/repo/search?count_only=1&uid=${this .uid }&team_id=${this .teamId }&q=&page=1&mode= ` ;
245251 response = await GET (totalCountSearchURL );
246- this .reposTotalCount = response .headers .get (' X-Total-Count' ) ?? ' ? ' ;
252+ this .reposTotalCount = parseInt ( response .headers .get (' X-Total-Count' ) ?? ' 0 ' ) ;
247253 }
248254
249255 response = await GET (searchedURL );
@@ -264,7 +270,7 @@ const sfc = {
264270 locale_latest_commit_status_state: webSearchRepo .locale_latest_commit_status ,
265271 };
266272 });
267- const count = response .headers .get (' X-Total-Count' );
273+ const count = parseInt ( response .headers .get (' X-Total-Count' ) );
268274 if (searchedQuery === ' ' && searchedMode === ' ' && this .archivedFilter === ' both' ) {
269275 this .reposTotalCount = count ;
270276 }
@@ -363,8 +369,8 @@ export default sfc; // activate the IDE's Vue plugin
363369 <svg-icon name =" octicon-plus" />
364370 </a >
365371 </h4 >
366- <div v-if =" isLoading" class =" ui attached segment" :class =" {'is-loading': isLoading}" />
367- <div v-if =" !isLoading && !repos.length " class =" ui attached segment empty-placeholder" >
372+ <div v-if =" isLoading && !reposTotalCount " class =" ui attached segment" :class =" {'is-loading': isLoading}" />
373+ <div v-if =" isRepoEmpty " class =" ui attached segment empty-placeholder" >
368374 <svg-icon name =" octicon-no-entry" :size =" 48" class-name =" repo-list-icon" />
369375 <h2 >{{ textNoRepo }}</h2 >
370376 <p >
@@ -378,10 +384,10 @@ export default sfc; // activate the IDE's Vue plugin
378384 </a >
379385 </p >
380386 </div >
381- <div v-if =" repos.length " class =" ui attached segment repos-search" >
387+ <div v-if =" reposTotalCount " class =" ui attached segment repos-search" >
382388 <div class =" ui small fluid action left icon input" >
383389 <input type =" search" spellcheck =" false" maxlength =" 255" @input =" changeReposFilter(reposFilter)" v-model =" searchQuery" ref =" search" @keydown =" reposFilterKeyControl" :placeholder =" textSearchRepos" >
384- <i class =" icon loading-icon-3px" ><svg-icon name =" octicon-search" :size =" 16" /></i >
390+ <i class =" icon loading-icon-3px" :class = " {'is-loading': isLoading} " ><svg-icon name =" octicon-search" :size =" 16" /></i >
385391 <div class =" ui dropdown icon button" :title =" textFilter" >
386392 <svg-icon name =" octicon-filter" :size =" 16" />
387393 <div class =" menu" >
@@ -492,7 +498,7 @@ export default sfc; // activate the IDE's Vue plugin
492498 </a >
493499 </h4 >
494500 <div v-if =" isLoading" class =" ui attached segment" :class =" {'is-loading': isLoading}" />
495- <div v-if =" !isLoading && !organizations.length " class =" ui attached segment empty-placeholder" >
501+ <div v-if =" isOrgEmpty " class =" ui attached segment empty-placeholder" >
496502 <svg-icon name =" octicon-no-entry" :size =" 48" class-name =" repo-list-icon" />
497503 <h2 >{{ textNoOrg }}</h2 >
498504 <p v-if =" canCreateOrganization" >
0 commit comments