Skip to content

Commit 7c9b875

Browse files
Fix isEmptyRepoRoot (#237)
1 parent 6f5d835 commit 7c9b875

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,12 @@ TEST: addTests('isRepo', [
397397
export const hasRepoHeader = (url: URL | HTMLAnchorElement | Location = location): boolean => isRepo(url) && !isRepoSearch(url);
398398
TEST: addTests('hasRepoHeader', combinedTestOnly);
399399

400-
// On empty repos, there's only isRepoHome; this element is found in `<head>`
401-
export const isEmptyRepoRoot = (): boolean => isRepoHome() && !exists('link[rel="canonical"]');
400+
export const isEmptyRepoRoot = (): boolean => isRepoHome() && exists([
401+
// If you don't have write access
402+
'.blankslate-icon',
403+
// If you have write access
404+
'#empty-setup-clone-url',
405+
].join(','));
402406

403407
export const isEmptyRepo = (): boolean => exists('[aria-label="Cannot fork because repository is empty."]');
404408

0 commit comments

Comments
 (0)