Skip to content

Commit

Permalink
fix(Collectionner): 🐛 Fixing book rematch and refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytuo committed Sep 9, 2023
1 parent 5e9a95d commit 787e5dd
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function Card({ book, provider, handleOpenDetails, onClick, type }: { book: IBoo
width: "250px",
height: "380px",
transition: "all 0.3s ease-in-out",
margin: "15px",
"&:hover": {
transform: "scale(1.1,1.1)",
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/ContentViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function ContentViewer({ provider, TheBook, type, handleAddBreadcrumbs, handleCh
TheBook = new Book("null", realname, null, "null", null, null, null, null, 0, 0, 1, 0, 0, 0, path, "null", null, 0, null, null, null, null, null, null, 0, provider.toString());
} else if (provider === providerEnum.MANUAL) {
console.log("manual");
InsertIntoDB("Books", "", `(?,'${null}','${realname}',null,${0},${0},${1},${0},${0},${0},'${path}','${null}','${null}','${null}','${null}',${null},'${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}',false)`);
InsertIntoDB("Books", "", `(${Math.floor(Math.random() * 100000)},'${null}','${realname}',null,${0},${0},${1},${0},${0},${0},'${path}','${null}','${null}','${null}','${null}',${null},'${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}',false)`);
TheBook = new Book("null", realname, null, "null", null, null, null, null, 0, 0, 1, 0, 0, 0, path, "null", null, 0, null, null, null, null, null, null, 0, provider.toString());
} else if (provider === providerEnum.OL) {
await new OpenLibrary().InsertBook(realname, path).then(async (cdata: any) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Details({ stateDetails, handleAddBreadcrumbs }: { stateDetails: { open:
handleAddBreadcrumbs(stateDetails.book.NOM, () => { });
}, []);
return (<>
{stateDetails && stateDetails.open ? <ContentViewer type={"volume"} provider={stateDetails.provider} TheBook={stateDetails.book} handleAddBreadcrumbs={handleAddBreadcrumbs} /> : <></>}
{stateDetails && stateDetails.open ? <ContentViewer type={"volume"} provider={parseInt(stateDetails.book.API_ID)} TheBook={stateDetails.book} handleAddBreadcrumbs={handleAddBreadcrumbs} /> : <></>}
</>);
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialogs/APISelectorDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function APISelectorDialog({ onClose, openModal }: {
label={t("selectAProvider")}
onChange={async (provider: any) => {
setProvider(provider.target.value);
await InsertIntoDB("Books", "", `(?,${null},'REPLACE THIS BY A VALUE',null,${0},${0},${1},${0},${0},${0},'${null}','${null}','${null}','${null}','${null}',${null},'${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}',0)`);
await InsertIntoDB("Books", "", `(${Math.floor(Math.random() * 100000)},${null},'REPLACE THIS BY A VALUE',null,${0},${0},${1},${0},${0},${0},'${null}','${null}','${null}','${null}','${null}',${null},'${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}',0)`);
const TheBookTemp = await getFromDB("Books", "* FROM Books WHERE NOM = 'REPLACE THIS BY A VALUE'");
if (TheBookTemp && TheBookTemp !== undefined && TheBookTemp !== null && typeof TheBookTemp === "string") {
setTheBook(tryToParse(TheBookTemp)[0]);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export default function MiniDrawer({
TheBook = new Book("null", realname, null, "null", null, null, null, null, 0, 0, 1, 0, 0, 0, path, "null", null, 0, null, null, null, null, null, null, 0, provider.toString());
} else if (provider === providerEnum.MANUAL) {
console.log("manual");
InsertIntoDB("Books", "", `(?,'${null}','${realname}',null,${0},${0},${1},${0},${0},${0},'${path}','${null}','${null}','${null}','${null}',${null},'${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}',false)`);
InsertIntoDB("Books", "", `(${Math.floor(Math.random() * 100000)},'${null}','${realname}',null,${0},${0},${1},${0},${0},${0},'${path}','${null}','${null}','${null}','${null}',${null},'${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}','${null}',false)`);
TheBook = new Book("null", realname, null, "null", null, null, null, null, 0, 0, 1, 0, 0, 0, path, "null", null, 0, null, null, null, null, null, null, 0, provider.toString());
} else if (provider === providerEnum.OL) {
await new OpenLibrary().InsertBook(realname, path).then(async (cdata: any) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function Loading() {
document.title = "Loading...";
setTimeout(() => {
window.location.href = "/login";
}, 15000);
}, 1000);
});
useLayoutEffect(() => {
document.querySelector("#navbar")?.classList.add("hidden");
Expand Down

0 comments on commit 787e5dd

Please sign in to comment.