diff --git a/package.json b/package.json index c1b1656..1ef8c8b 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "dev": "vite", "build": "yarn workspace @echo/web tsc && vite build --emptyOutDir", "format": "prettier --check \"packages/**/*.{ts, tsx}\"", + "format:fix": "prettier --write \"packages/**/*.{ts, tsx}\"", "gen": "yarn plop", "lint": "yarn workspaces run lint", "preview": "yarn workspace @echo/web vite preview", @@ -45,4 +46,4 @@ "packages/workflows/*", "packages/workers/*" ] -} \ No newline at end of file +} diff --git a/packages/infrastructure/spotify-player/index.ts b/packages/infrastructure/spotify-player/index.ts index 12c6827..cdf0447 100644 --- a/packages/infrastructure/spotify-player/index.ts +++ b/packages/infrastructure/spotify-player/index.ts @@ -17,6 +17,7 @@ import { Option, pipe, Queue, + Runtime, Scope, Stream, } from "effect"; @@ -73,12 +74,14 @@ const make = Effect.gen(function* () { const deferredUntilRegistered = yield* Deferred.make(); + const runtime = yield* Effect.runtime(); + yield* Stream.async((emit) => { window.onSpotifyWebPlaybackSDKReady = () => { const player = new window.Spotify.Player({ name: "Echo", getOAuthToken: (cb) => - Effect.runPromise( + Runtime.runPromise(runtime)( authCache .get(ApiBasedProviderId.Spotify) .pipe(Effect.map(Option.getOrElse(() => authInfo))),