mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Pass "fork" for Nostr URIs in Clone page
This commit is contained in:
1 file changed
+13
-1
+13
-1
@@ -155,10 +155,22 @@ export default function Clone() {
|
||||
// Extract repository name
|
||||
const repoName = await extractRepoName(targetUrl);
|
||||
|
||||
// Determine if this is a fork (cloning from someone else's Nostr repository)
|
||||
let fork = false;
|
||||
if (targetUrl.startsWith('nostr://') && user) {
|
||||
try {
|
||||
const nostrURI = await NostrURI.parse(targetUrl);
|
||||
fork = nostrURI.pubkey !== user.pubkey;
|
||||
} catch {
|
||||
// If parsing fails, default to fork=false
|
||||
}
|
||||
}
|
||||
|
||||
// Clone the repository (Git class handles both regular Git URLs and Nostr URIs)
|
||||
const project = await projectsManager.cloneProject({
|
||||
name: repoName,
|
||||
repoUrl: targetUrl.trim(),
|
||||
fork,
|
||||
});
|
||||
|
||||
// Determine success message based on URL type
|
||||
@@ -209,7 +221,7 @@ export default function Clone() {
|
||||
} finally {
|
||||
setIsCloning(false);
|
||||
}
|
||||
}, [navigate, projectsManager, repoUrl, t, toast, validateGitUrl]);
|
||||
}, [navigate, projectsManager, repoUrl, t, toast, validateGitUrl, user]);
|
||||
|
||||
const handleKeyDown = (e: React.KeyboardEvent) => {
|
||||
if (e.key === 'Enter' && !isCloning) {
|
||||
|
||||
Reference in new issue
Block a user