From 6f224c6e2c4a016f7ea17ff998c4b4e56b9a4f9b Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Sat, 13 Apr 2024 13:13:14 +0100 Subject: [PATCH] enable post.html in dev --- bskyembed/src/screens/post.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bskyembed/src/screens/post.tsx b/bskyembed/src/screens/post.tsx index 76c921540e..0419b8d88b 100644 --- a/bskyembed/src/screens/post.tsx +++ b/bskyembed/src/screens/post.tsx @@ -16,7 +16,13 @@ const agent = new BskyAgent({ service: 'https://public.api.bsky.app', }) -const uri = `at://${window.location.pathname.slice('/embed/'.length)}` +let uri +// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access +if (import.meta.env.DEV) { + uri = new URLSearchParams(window.location.search).get('uri') +} else { + uri = `at://${window.location.pathname.slice('/embed/'.length)}` +} console.log(uri)