mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: handle delete page
This commit is contained in:
parent
6f0d645d8b
commit
b9be46b337
1 changed files with 11 additions and 6 deletions
|
|
@ -185,12 +185,17 @@ export function attachCopySnippet() {
|
|||
}
|
||||
},
|
||||
() => {
|
||||
const plainReadmeSelector = '.repository-content div#readme .plain'
|
||||
$(plainReadmeSelector, undefined, () =>
|
||||
raiseError(
|
||||
new Error('cannot find mount point for copy snippet button while readme exists'),
|
||||
),
|
||||
)
|
||||
// in URL like `/{user}/{repo}/delete/{branch}/path/to/file
|
||||
const deleteReadmeSelector = '.repository-content div#readme del'
|
||||
if (!$(deleteReadmeSelector)) {
|
||||
// in pages where readme is not markdown, e.g. txt
|
||||
const plainReadmeSelector = '.repository-content div#readme .plain'
|
||||
if (!$(plainReadmeSelector)) {
|
||||
raiseError(
|
||||
new Error('cannot find mount point for copy snippet button while readme exists'),
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue