diff --git a/package.json b/package.json index 97b129f831..4a9981a551 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "open-analyzer": "EXPO_PUBLIC_OPEN_ANALYZER=1 yarn build-web" }, "dependencies": { - "@atproto/api": "^0.12.19-next.0", + "@atproto/api": "0.12.19-next.0", "@bam.tech/react-native-image-resizer": "^3.0.4", "@braintree/sanitize-url": "^6.0.2", "@discord/bottom-sheet": "bluesky-social/react-native-bottom-sheet", diff --git a/src/components/StarterPack/QrCodeDialog.tsx b/src/components/StarterPack/QrCodeDialog.tsx index 979e72e7f1..909e86088e 100644 --- a/src/components/StarterPack/QrCodeDialog.tsx +++ b/src/components/StarterPack/QrCodeDialog.tsx @@ -96,6 +96,7 @@ export function QrCodeDialog({ await setImageAsync(base64) } else { const canvas = await getCanvas(uri) + // @ts-expect-error web only canvas.toBlob((blob: Blob) => { const item = new ClipboardItem({'image/png': blob}) navigator.clipboard.write([item]) diff --git a/src/components/hooks/useStarterPackEntry.ts b/src/components/hooks/useStarterPackEntry.ts index b6cf2cade8..bee4da3142 100644 --- a/src/components/hooks/useStarterPackEntry.ts +++ b/src/components/hooks/useStarterPackEntry.ts @@ -16,7 +16,7 @@ export function useStarterPackEntry() { if (name && rkey) { setUsedStarterPack({ - uri: window.href, + uri: window.location.href, }) } } else { diff --git a/src/lib/generate-starterpack.ts b/src/lib/generate-starterpack.ts index e8787dc54f..c68d0cabef 100644 --- a/src/lib/generate-starterpack.ts +++ b/src/lib/generate-starterpack.ts @@ -16,8 +16,8 @@ export const createStarterPackList = async ({ descriptionFacets?: Facet[] profiles: AppBskyActorDefs.ProfileViewBasic[] agent: BskyAgent -}): Promise<{uri: string; cid: string} | undefined> => { - if (profiles.length === 0) return +}): Promise<{uri: string; cid: string}> => { + if (profiles.length === 0) throw new Error('No profiles given') const list = await agent.app.bsky.graph.list.create( {repo: agent.session!.did}, @@ -90,7 +90,7 @@ export async function generateStarterpack({ }, { name: defaultName ?? '', - list: list?.uri, + list: list.uri, createdAt: new Date().toISOString(), }, ) diff --git a/src/screens/StarterPack/Wizard/index.tsx b/src/screens/StarterPack/Wizard/index.tsx index 0c6e2dd409..6ef54535ad 100644 --- a/src/screens/StarterPack/Wizard/index.tsx +++ b/src/screens/StarterPack/Wizard/index.tsx @@ -333,7 +333,7 @@ function WizardInner({ name: state.name ?? defaultName, description: state.description, descriptionFacets: [], - list: list?.uri, + list: list.uri, feeds: state.feeds.map(f => ({ uri: f.uri, })), diff --git a/yarn.lock b/yarn.lock index b6f55c769b..9ac8e622cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -34,10 +34,10 @@ jsonpointer "^5.0.0" leven "^3.1.0" -"@atproto/api@^0.12.19-next.0": - version "0.12.19" - resolved "https://registry.yarnpkg.com/@atproto/api/-/api-0.12.19.tgz#6d842269b6b9cd3fc5864e12824d4fb04cc033cf" - integrity sha512-dsiTpjqBhjGwNW/qG/tLSgUQnmOSvd8hsQr5d8GCUDGK2AEHWl0KNgLPbwxIBEIo8Jg9NHsvqV7BMoix8YreIg== +"@atproto/api@0.12.19-next.0": + version "0.12.19-next.0" + resolved "https://registry.yarnpkg.com/@atproto/api/-/api-0.12.19-next.0.tgz#9592476cbdba8482d0fd8d65e20275c95d6d5fd4" + integrity sha512-wyWr4uIabTgDTBY99y3QyrFxcIx1Mh4DkURgSv8sd/b+w0lfrZAJh0Gg9BXdg/iIjcf/M2lCTL04r0vASfkMVg== dependencies: "@atproto/common-web" "^0.3.0" "@atproto/lexicon" "^0.4.0"