From 646e59056420538f31bec91c5aa3670b180a5ab2 Mon Sep 17 00:00:00 2001 From: Simon Chan <1330321+yume-chan@users.noreply.github.com> Date: Thu, 18 Apr 2024 20:00:14 +0800 Subject: [PATCH] fix: fix eslint errors --- .github/workflows/publish.yml | 4 ++-- .github/workflows/pull_request.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- libraries/scrcpy-decoder-webcodecs/src/index.ts | 7 +++++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 468e4e73..f7491108 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,10 +12,10 @@ jobs: id-token: write steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index eb542b31..a8cc5dd4 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -20,12 +20,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c835a323..afadee95 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,10 +20,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} diff --git a/libraries/scrcpy-decoder-webcodecs/src/index.ts b/libraries/scrcpy-decoder-webcodecs/src/index.ts index da7f7c11..e539e3fe 100644 --- a/libraries/scrcpy-decoder-webcodecs/src/index.ts +++ b/libraries/scrcpy-decoder-webcodecs/src/index.ts @@ -125,7 +125,10 @@ export class WebCodecsVideoDecoder implements ScrcpyVideoDecoder { if (controller) { try { controller.error(e); - } catch {} + } catch { + // ignore + // `controller` may already in error state + } } else { error = e; } @@ -142,7 +145,7 @@ export class WebCodecsVideoDecoder implements ScrcpyVideoDecoder { controller = _controller; } }, - write: (packet, _controller) => { + write: (packet) => { if (this.#codec === ScrcpyVideoCodecId.AV1) { if (packet.type === "configuration") { return;