Skip to content

Commit

Permalink
fix(Output): linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarpl committed Mar 11, 2024
1 parent 49ff5e0 commit 538d540
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions packages/apps/client/src/views/Output/Output.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { findClosestElement } from '../../lib/findClosestElement'
type AnyElementId = SegmentId | PartId | TextMarkerId

function createState(
timestamp: number,
rootEl: HTMLElement,
fontSizePx: number,
positionPx: number,
Expand All @@ -48,7 +49,7 @@ function createState(
}

return {
timestamp: getCurrentTime(),
timestamp,
state: {
speed,
offset: {
Expand Down Expand Up @@ -91,7 +92,7 @@ const Output = observer(function Output(): React.ReactElement {
if (!rootEl.current) return
const aspectRatio = size.width / size.height

const state = createState(rootEl.current, fontSizePx, position, speed, animatedOffset)
const state = createState(timestamp, rootEl.current, fontSizePx, position, speed, animatedOffset)
RootAppStore.viewportStore.update(aspectRatio, state)
},
[rootEl, size, fontSizePx, isPrimary]
Expand All @@ -115,7 +116,14 @@ const Output = observer(function Output(): React.ReactElement {
if (!rootEl.current) return
const aspectRatio = size.width / size.height

const state = createState(rootEl.current, fontSizePx, position.current, speed.current, animatedOffset.current)
const state = createState(
getCurrentTime(),
rootEl.current,
fontSizePx,
position.current,
speed.current,
animatedOffset.current
)

RootAppStore.viewportStore.update(aspectRatio, state)
},
Expand Down Expand Up @@ -171,7 +179,14 @@ const Output = observer(function Output(): React.ReactElement {
if (!isPrimary) return
if (!fontSizePx) return

const state = createState(rootEl.current, fontSizePx, position.current, speed.current, animatedOffset.current)
const state = createState(
getCurrentTime(),
rootEl.current,
fontSizePx,
position.current,
speed.current,
animatedOffset.current
)

RootAppStore.viewportStore.update(aspectRatio, state)
}, [rootEl, fontSizePx, isPrimary, position, speed, animatedOffset])
Expand Down

0 comments on commit 538d540

Please sign in to comment.