Fix linter errors

This commit is contained in:
Alex Gleason committed 2025-10-15 12:01:32 -05:00
1 parent 1c4b1e6263
commit 8c125db804
10 files changed
+79 -72

No files matched your search

@@ -71,15 +71,6 @@ export function AnnounceRepositoryDialog({
}
}, [open]);
useEffect(() => {
if (isOpen && remoteUrl) {
// Parse remote URL to pre-fill data
parseRemoteUrl(remoteUrl);
// Get earliest commit
getEarliestCommit();
}
}, [isOpen, remoteUrl, parseRemoteUrl, getEarliestCommit]);
const parseRemoteUrl = useCallback((url: string) => {
// Extract repo ID from Nostr URL
if (url.startsWith('nostr://')) {
@@ -114,6 +105,15 @@ export function AnnounceRepositoryDialog({
}
}, [git, projectPath]);
useEffect(() => {
if (isOpen && remoteUrl) {
// Parse remote URL to pre-fill data
parseRemoteUrl(remoteUrl);
// Get earliest commit
getEarliestCommit();
}
}, [isOpen, remoteUrl, parseRemoteUrl, getEarliestCommit]);
const addWebUrl = () => {
if (newWebUrl.trim() && !webUrls.includes(newWebUrl.trim())) {
setWebUrls([...webUrls, newWebUrl.trim()]);
+28 -28
View File
@@ -141,6 +141,33 @@ export function PullRequestDialog({
return;
}
const ensureFork = async (info: RemoteInfo, token: string): Promise<{ owner: string; repo: string; url: string }> => {
console.log('=== ENSURE FORK ===');
console.log('Repository:', `${info.owner}/${info.repo}`);
// First check if fork already exists
const user = await getCurrentUser(info, token);
console.log('Current user:', user.username);
const existingFork = await checkForkExists(info, token, user.username);
if (existingFork) {
console.log('Found existing fork:', existingFork);
return existingFork;
}
// Create fork
console.log('No existing fork found, creating new fork...');
const fork = await createFork(info, token);
console.log('Fork created:', fork);
// Wait a bit for fork to be ready
console.log('Waiting 2 seconds for fork to be ready...');
await new Promise(resolve => setTimeout(resolve, 2000));
return fork;
};
setIsCheckingPermissions(true);
try {
const credentials = findCredentialsForRepo(remoteUrl, settings.credentials);
@@ -178,7 +205,7 @@ export function PullRequestDialog({
} finally {
setIsCheckingPermissions(false);
}
}, [remoteInfo, remoteUrl, settings.credentials, ensureFork]);
}, [remoteInfo, remoteUrl, settings.credentials]);
useEffect(() => {
if (isOpen && remoteUrl) {
@@ -569,33 +596,6 @@ export function PullRequestDialog({
}
};
const ensureFork = async (info: RemoteInfo, token: string): Promise<{ owner: string; repo: string; url: string }> => {
console.log('=== ENSURE FORK ===');
console.log('Repository:', `${info.owner}/${info.repo}`);
// First check if fork already exists
const user = await getCurrentUser(info, token);
console.log('Current user:', user.username);
const existingFork = await checkForkExists(info, token, user.username);
if (existingFork) {
console.log('Found existing fork:', existingFork);
return existingFork;
}
// Create fork
console.log('No existing fork found, creating new fork...');
const fork = await createFork(info, token);
console.log('Fork created:', fork);
// Wait a bit for fork to be ready
console.log('Waiting 2 seconds for fork to be ready...');
await new Promise(resolve => setTimeout(resolve, 2000));
return fork;
};
const getCurrentUser = async (info: RemoteInfo, token: string): Promise<{ username: string }> => {
const url = info.platform === 'github' ? `${info.apiUrl}/user` : `${info.apiUrl}/user`;
const headers: Record<string, string> = info.platform === 'github'
+1 -4
View File
@@ -106,13 +106,12 @@ export function PullRequestForm({ projectId, currentBranch, remoteUrl }: PullReq
} else {
setError('Unsupported remote URL format');
}
} catch (err) {
} catch {
setError('Failed to parse remote URL');
}
}, []);
const loadRemoteBranches = useCallback(async () => {
setIsLoadingBranches(true);
try {
const branches = await git.listBranches({
dir: projectPath,
@@ -129,8 +128,6 @@ export function PullRequestForm({ projectId, currentBranch, remoteUrl }: PullReq
}
} catch {
setRemoteBranches(['main', 'master', 'develop']);
} finally {
setIsLoadingBranches(false);
}
}, [git, projectPath]);