Removed useless console.logs, switched errors to console.error
This commit is contained in:
parent
8705feffbc
commit
582e64db0d
@ -21,11 +21,8 @@ export const useBookState = (
|
||||
}, [hash]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log(Boolean(!ready && state?.currentPage && goToPage));
|
||||
if (!ready && state?.currentPage && pagesReady) {
|
||||
console.log("Go to", state.currentPage);
|
||||
goToPage(state.currentPage);
|
||||
console.log("Ready");
|
||||
setReady(true);
|
||||
} else if (hash && !ready && pagesReady && typeof state === "object") {
|
||||
saveBookState(hash, { currentPage: 0 });
|
||||
@ -36,7 +33,6 @@ export const useBookState = (
|
||||
useEffect(
|
||||
() => () => {
|
||||
if (hash) {
|
||||
console.log(currentPage);
|
||||
if (ready && state) saveBookState(hash, state);
|
||||
else saveBookState(hash, { currentPage: currentPage.current || 0 });
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ self.addEventListener("fetch", (event) => {
|
||||
let handlers: PathHandler[];
|
||||
|
||||
if (request.url.startsWith(API_URL)) {
|
||||
console.log("API: ", path);
|
||||
handlers = [
|
||||
{ path: "/list", getResponse: () => handleBooks() },
|
||||
{ path: "/book/", getResponse: () => handleBook(request, getHash(path)) },
|
||||
|
@ -34,7 +34,7 @@ export const submitFile = async (
|
||||
|
||||
return await res.json();
|
||||
} catch (err) {
|
||||
console.log("Network error:", err.message);
|
||||
console.error("Network error:", err.message);
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
@ -44,7 +44,7 @@ export const validateResponse = (content: unknown): content is BookT => {
|
||||
for (const key of requiredBookProps)
|
||||
if (!(key in content)) {
|
||||
if (process.env.NODE_ENV === "development")
|
||||
console.log(`${key} is not specified in server response`);
|
||||
console.error(`${key} is not specified in server response`);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user