0.2.89
This commit is contained in:
1 parent
9e133628e5
commit
0abc8e871d
6 files changed
+47
-7
No files matched your search
+3
-1
@@ -164,7 +164,9 @@ export async function api(path, options = {}) {
|
||||
logWarn("api.timeout", { method: options.method || "GET", path });
|
||||
throw new Error(translateApiMessage("Timed out"));
|
||||
}
|
||||
logError("api.network_error", error, { method: options.method || "GET", path });
|
||||
// HTTP failures have already been logged as api.failed above.
|
||||
// Only transport failures should be reported as network errors.
|
||||
if (!error?.status) logError("api.network_error", error, { method: options.method || "GET", path });
|
||||
if (options.body instanceof FormData && error instanceof TypeError) {
|
||||
throw new Error(translateApiMessage("Upload failed before the server returned a response. The file may exceed the server or proxy upload limit."));
|
||||
}
|
||||
|
||||
@@ -277,7 +277,9 @@ export function startNoteEditor(adapter) {
|
||||
setMarkdownMentions([]);
|
||||
mentionAutocomplete.setUsers([]);
|
||||
mentionNavigator.setUsers([]);
|
||||
if (!accountSession) { render(); return; }
|
||||
// Session validation can finish before loadNoteInfo(); avoid a premature
|
||||
// request (and a second request when note info becomes available).
|
||||
if (!accountSession || !info) { render(); return; }
|
||||
try {
|
||||
const params = new URLSearchParams({ kind: adapter.access.kind, slug: adapter.access.key });
|
||||
const response = await api(`/api/auth/resources/mentions?${params}`);
|
||||
|
||||
Reference in new issue
Block a user