Banned and chat disconnected states will hide chat. Closes #2764

This commit is contained in:
Gabe Kangas
2023-03-13 15:23:14 -07:00
parent 2364293742
commit 0f58f8c0fe
7 changed files with 81 additions and 46 deletions

View File

@@ -150,21 +150,14 @@ export async function fetchData(url: string, options?: FetchOptions) {
requestOptions.credentials = 'include';
}
try {
const response = await fetch(url, requestOptions);
const json = await response.json();
const response = await fetch(url, requestOptions);
const json = await response.json();
if (!response.ok) {
const message = json.message || `An error has occurred: ${response.status}`;
throw new Error(message);
}
return json;
} catch (error) {
console.error(error);
return error;
// console.log(error)
// throw new Error(error)
if (!response.ok) {
const message = json.message || `An error has occurred: ${response.status}`;
throw new Error(message);
}
return json;
}
export async function getUnauthedData(url: string, options?: FetchOptions) {