Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope willRender to PageRenderer only #741

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/core/drive/page_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ export class PageRenderer extends Renderer {
}
}

constructor(currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {
super(currentSnapshot, newSnapshot, renderElement, isPreview)
this.willRender = willRender
}

get shouldRender() {
return this.newSnapshot.isVisitable && this.trackedElementsAreIdentical
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/frames/frame_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export class FrameController {

if (newFrameElement) {
const snapshot = new Snapshot(newFrameElement)
const renderer = new FrameRenderer(this, this.view.snapshot, snapshot, FrameRenderer.renderElement, false, false)
const renderer = new FrameRenderer(this, this.view.snapshot, snapshot, FrameRenderer.renderElement, false)
if (this.view.renderPromise) await this.view.renderPromise
this.changeHistory()

Expand Down
4 changes: 2 additions & 2 deletions src/core/frames/frame_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class FrameRenderer extends Renderer {
}
}

constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {
super(currentSnapshot, newSnapshot, renderElement, isPreview, willRender)
constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview) {
super(currentSnapshot, newSnapshot, renderElement, isPreview)
this.delegate = delegate
}

Expand Down
3 changes: 1 addition & 2 deletions src/core/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { Bardo } from "./bardo"
export class Renderer {
#activeElement = null

constructor(currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {
constructor(currentSnapshot, newSnapshot, renderElement, isPreview) {
this.currentSnapshot = currentSnapshot
this.newSnapshot = newSnapshot
this.isPreview = isPreview
this.willRender = willRender
this.renderElement = renderElement
this.promise = new Promise((resolve, reject) => (this.resolvingFunctions = { resolve, reject }))
}
Expand Down
Loading