if (branches.length > 0 && !branches.includes(currentBranch)) {
currentBranch = branches[0];
}
} else if (response.status === 404) {
// Repository not provisioned yet - set error message and flag
repoNotFound = true;
error = `Repository not found. This repository exists in Nostr but hasn't been provisioned on this server yet. The server will automatically provision it soon, or you can contact the server administrator.`;
}
} catch (err) {
console.error('Failed to load branches:', err);
@ -504,6 +516,9 @@
@@ -504,6 +516,9 @@
}
async function loadFiles(path: string = '') {
// Skip if repository doesn't exist
if (repoNotFound) return;
loading = true;
error = null;
try {
@ -511,6 +526,10 @@
@@ -511,6 +526,10 @@
const response = await fetch(url);
if (!response.ok) {
if (response.status === 404) {
repoNotFound = true;
throw new Error(`Repository not found. This repository exists in Nostr but hasn't been provisioned on this server yet. The server will automatically provision it soon, or you can contact the server administrator.`);
}
throw new Error(`Failed to load files: ${response.statusText}`);