diff options
Diffstat (limited to 'apps/mobile')
| -rw-r--r-- | apps/mobile/app/dashboard/bookmarks/new.tsx | 8 | ||||
| -rw-r--r-- | apps/mobile/app/sharing.tsx | 18 | ||||
| -rw-r--r-- | apps/mobile/lib/upload.ts | 7 |
3 files changed, 27 insertions, 6 deletions
diff --git a/apps/mobile/app/dashboard/bookmarks/new.tsx b/apps/mobile/app/dashboard/bookmarks/new.tsx index 51db6d97..25882d7f 100644 --- a/apps/mobile/app/dashboard/bookmarks/new.tsx +++ b/apps/mobile/app/dashboard/bookmarks/new.tsx @@ -48,9 +48,13 @@ const NoteEditorPage = () => { if (url.protocol != "http:" && url.protocol != "https:") { throw new Error(`Unsupported URL protocol: ${url.protocol}`); } - createBookmark({ type: BookmarkTypes.LINK, url: data }); + createBookmark({ type: BookmarkTypes.LINK, url: data, source: "mobile" }); } catch { - createBookmark({ type: BookmarkTypes.TEXT, text: data }); + createBookmark({ + type: BookmarkTypes.TEXT, + text: data, + source: "mobile", + }); } }; diff --git a/apps/mobile/app/sharing.tsx b/apps/mobile/app/sharing.tsx index 1e5df4b8..3e2b6bfb 100644 --- a/apps/mobile/app/sharing.tsx +++ b/apps/mobile/app/sharing.tsx @@ -44,14 +44,26 @@ function SaveBookmark({ setMode }: { setMode: (mode: Mode) => void }) { return; } if (!isPending && shareIntent.webUrl) { - mutate({ type: BookmarkTypes.LINK, url: shareIntent.webUrl }); + mutate({ + type: BookmarkTypes.LINK, + url: shareIntent.webUrl, + source: "mobile", + }); } else if (!isPending && shareIntent?.text) { const val = z.string().url(); if (val.safeParse(shareIntent.text).success) { // This is a URL, else treated as text - mutate({ type: BookmarkTypes.LINK, url: shareIntent.text }); + mutate({ + type: BookmarkTypes.LINK, + url: shareIntent.text, + source: "mobile", + }); } else { - mutate({ type: BookmarkTypes.TEXT, text: shareIntent.text }); + mutate({ + type: BookmarkTypes.TEXT, + text: shareIntent.text, + source: "mobile", + }); } } else if (!isPending && shareIntent?.files) { uploadAsset({ diff --git a/apps/mobile/lib/upload.ts b/apps/mobile/lib/upload.ts index a9157d68..0eeab380 100644 --- a/apps/mobile/lib/upload.ts +++ b/apps/mobile/lib/upload.ts @@ -61,7 +61,12 @@ export function useUploadAsset( const assetId = resp.assetId; const assetType = resp.contentType === "application/pdf" ? "pdf" : "image"; - createBookmark({ type: BookmarkTypes.ASSET, assetId, assetType }); + createBookmark({ + type: BookmarkTypes.ASSET, + assetId, + assetType, + source: "mobile", + }); }, onError: (e) => { if (options.onError) { |
