Skip to content

Commit

Permalink
Fix some issues with SSR on LibraryPage
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav2070 committed Dec 24, 2024
1 parent 7c4faec commit 6676f7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app/misc/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ export function GetDualScreenSettings() {
dualScreenFoldMargin: 0
}

if (isServer()) {
return settings
}

let screenSegments: any

if (window["getWindowSegments"]) {
Expand Down
4 changes: 3 additions & 1 deletion src/app/pages/library-page/library-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { EpubBook } from "src/app/models/EpubBook"
import { PdfBook } from "src/app/models/PdfBook"
import { UpdateBookOrder } from "src/app/models/BookOrder"
import { environment } from "src/environments/environment"
import { GetDualScreenSettings } from "src/app/misc/utils"
import { GetDualScreenSettings, isServer } from "src/app/misc/utils"

const pdfType = "application/pdf"
const showAllBooksAnimationDuration = 300
Expand Down Expand Up @@ -115,6 +115,8 @@ export class LibraryPageComponent {

@HostListener("window:resize")
setSize() {
if (isServer()) return

this.height = window.innerHeight
this.smallBookList = window.innerWidth < 650

Expand Down

0 comments on commit 6676f7d

Please sign in to comment.