- {/* Loading content */}
{message}
+ {progress !== undefined && (
+
+
+ {progressText &&
{progressText}
}
+
+ )}
);
diff --git a/app/lib/hooks/useGit.ts b/app/lib/hooks/useGit.ts
index 3c8c61bb..cfa5027b 100644
--- a/app/lib/hooks/useGit.ts
+++ b/app/lib/hooks/useGit.ts
@@ -49,50 +49,54 @@ export function useGit() {
}
fileData.current = {};
- await git.clone({
- fs,
- http,
- dir: webcontainer.workdir,
- url,
- depth: 1,
- singleBranch: true,
- corsProxy: 'https://cors.isomorphic-git.org',
- onAuth: (url) => {
- // let domain=url.split("/")[2]
- let auth = lookupSavedPassword(url);
+ try {
+ await git.clone({
+ fs,
+ http,
+ dir: webcontainer.workdir,
+ url,
+ depth: 1,
+ singleBranch: true,
+ corsProxy: '/api/git-proxy',
+ onAuth: (url) => {
+ let auth = lookupSavedPassword(url);
- if (auth) {
- return auth;
- }
+ if (auth) {
+ return auth;
+ }
- if (confirm('This repo is password protected. Ready to enter a username & password?')) {
- auth = {
- username: prompt('Enter username'),
- password: prompt('Enter password'),
- };
- return auth;
- } else {
- return { cancel: true };
- }
- },
- onAuthFailure: (url, _auth) => {
- toast.error(`Error Authenticating with ${url.split('/')[2]}`);
- },
- onAuthSuccess: (url, auth) => {
- saveGitAuth(url, auth);
- },
- });
+ if (confirm('This repo is password protected. Ready to enter a username & password?')) {
+ auth = {
+ username: prompt('Enter username'),
+ password: prompt('Enter password'),
+ };
+ return auth;
+ } else {
+ return { cancel: true };
+ }
+ },
+ onAuthFailure: (url, _auth) => {
+ toast.error(`Error Authenticating with ${url.split('/')[2]}`);
+ },
+ onAuthSuccess: (url, auth) => {
+ saveGitAuth(url, auth);
+ },
+ });
- const data: Record