From 4657c6b44d541264f764ecb023285801b3dce49d Mon Sep 17 00:00:00 2001 From: David Hu Date: Wed, 26 Jun 2024 09:16:35 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20multiple=20hash=20loader=20wit?= =?UTF-8?q?h=20different=20color=20renders=20as=20the=20same=20co=E2=80=A6?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ae4a2c5b2ddb17fa7a88f3edb890f9509062ba17. --- .github/workflows/deploy.yml | 4 ---- .gitignore | 3 +-- src/helpers/animation.server.test.ts | 2 +- src/helpers/animation.test.ts | 2 +- src/helpers/animation.ts | 14 +------------- 5 files changed, 4 insertions(+), 21 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9deba1f6..2bb62185 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,10 +6,6 @@ on: pull_request: branches: [main] -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - permissions: contents: read pages: write diff --git a/.gitignore b/.gitignore index 7b05cb58..c4ef7626 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,4 @@ umd .yarn/cache .yarn/install-state.gz stories/*.tsx -storybook-static -coverage \ No newline at end of file +storybook-static \ No newline at end of file diff --git a/src/helpers/animation.server.test.ts b/src/helpers/animation.server.test.ts index 2a7010ed..7e8bf233 100644 --- a/src/helpers/animation.server.test.ts +++ b/src/helpers/animation.server.test.ts @@ -11,6 +11,6 @@ describe("animation", () => { "0% {left: -35%;right: 100%} 60% {left: 100%;right: -90%} 100% {left: 100%;right: -90%}", "my-suffix" ); - expect(name).toMatch(/^react-spinners-TestLoader-my-suffix/); + expect(name).toEqual("react-spinners-TestLoader-my-suffix"); }); }); diff --git a/src/helpers/animation.test.ts b/src/helpers/animation.test.ts index 0e002f0f..4067872f 100644 --- a/src/helpers/animation.test.ts +++ b/src/helpers/animation.test.ts @@ -7,6 +7,6 @@ describe("createAnimation", () => { "0% {left: -35%;right: 100%} 60% {left: 100%;right: -90%} 100% {left: 100%;right: -90%}", "my-suffix" ); - expect(name).toMatch(/^react-spinners-TestLoader-my-suffix/); + expect(name).toEqual("react-spinners-TestLoader-my-suffix"); }); }); diff --git a/src/helpers/animation.ts b/src/helpers/animation.ts index 2069f5a4..fa2a5d93 100644 --- a/src/helpers/animation.ts +++ b/src/helpers/animation.ts @@ -1,5 +1,5 @@ export const createAnimation = (loaderName: string, frames: string, suffix: string): string => { - const animationName = `react-spinners-${loaderName}-${suffix}-${animationSuffix(10)}`; + const animationName = `react-spinners-${loaderName}-${suffix}`; if (typeof window == "undefined" || !window.document) { return animationName; @@ -21,15 +21,3 @@ export const createAnimation = (loaderName: string, frames: string, suffix: stri return animationName; }; - -function animationSuffix(length: number) { - let result = ""; - const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - const charactersLength = characters.length; - let counter = 0; - while (counter < length) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - counter += 1; - } - return result; -}