Skip to content

Commit

Permalink
Fix timeline mouse over + space interaction (#336)
Browse files Browse the repository at this point in the history
* env

* always seek when space is pressed and editor isn't playing
  • Loading branch information
Brendonovich authored Feb 21, 2025
1 parent 42b9260 commit 62f96dc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ jobs:
node-version: "20"
cache: pnpm

- name: Create .env file in root
run: |
echo "VITE_ENVIRONMENT=production" >> .env
echo "CAP_DESKTOP_SENTRY_URL=https://6a3b6a09e6ae976c2ad6fff710e88748@o4506859771527168.ingest.us.sentry.io/4508330917101568" >> .env
echo "NEXT_PUBLIC_WEB_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}" >> .env
echo 'NEXTAUTH_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
echo 'NEXT_PUBLIC_POSTHOG_KEY=${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }}' >> .env
echo 'NEXT_PUBLIC_POSTHOG_HOST=${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }}' >> .env
echo 'VITE_POSTHOG_KEY=${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }}' >> .env
echo 'VITE_POSTHOG_HOST=${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }}' >> .env
echo 'VITE_SERVER_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
echo "NEXT_PUBLIC_CAP_AWS_REGION=${{ secrets.NEXT_PUBLIC_CAP_AWS_REGION }}" >> .env
echo "NEXT_PUBLIC_CAP_AWS_BUCKET=${{ secrets.NEXT_PUBLIC_CAP_AWS_BUCKET }}" >> .env
- name: Copy .env to apps/desktop
run: cp .env apps/desktop/.env

- name: Run setup
run: |
pnpm cap-setup
Expand Down
11 changes: 7 additions & 4 deletions apps/desktop/src/routes/editor/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,14 @@ export function Player() {
createEventListener(document, "keydown", async (e: KeyboardEvent) => {
if (e.code === "Space" && e.target === document.body) {
e.preventDefault();
const time = previewTime();
if (!playing() && time !== undefined) {
setPlaybackTime(time);
await commands.seekTo(Math.floor(time * FPS));
const prevTime = previewTime();

if (!playing()) {
if (prevTime !== undefined) setPlaybackTime(prevTime);

await commands.seekTo(Math.floor(playbackTime() * FPS));
}

await handlePlayPauseClick();
}
});
Expand Down

1 comment on commit 62f96dc

@vercel
Copy link

@vercel vercel bot commented on 62f96dc Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.