We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isEmptyRepoRoot
1 parent 6f5d835 commit 7c9b875Copy full SHA for 7c9b875
1 file changed
index.ts
@@ -397,8 +397,12 @@ TEST: addTests('isRepo', [
397
export const hasRepoHeader = (url: URL | HTMLAnchorElement | Location = location): boolean => isRepo(url) && !isRepoSearch(url);
398
TEST: addTests('hasRepoHeader', combinedTestOnly);
399
400
-// On empty repos, there's only isRepoHome; this element is found in `<head>`
401
-export const isEmptyRepoRoot = (): boolean => isRepoHome() && !exists('link[rel="canonical"]');
+export const isEmptyRepoRoot = (): boolean => isRepoHome() && exists([
+ // If you don't have write access
402
+ '.blankslate-icon',
403
+ // If you have write access
404
+ '#empty-setup-clone-url',
405
+].join(','));
406
407
export const isEmptyRepo = (): boolean => exists('[aria-label="Cannot fork because repository is empty."]');
408
0 commit comments