Skip to content

Commit

Permalink
Use FS path for {{{PageUrl}}} on local PDFs
Browse files Browse the repository at this point in the history
- For uploaded local PDFs it would prev resolve the upload locator and thus the memex.cloud/ct/ URL
  • Loading branch information
poltak committed Feb 27, 2024
1 parent 91881f9 commit 3f7dd6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion external/@worldbrain/memex-common
6 changes: 5 additions & 1 deletion src/copy-paster/background/template-data-fetchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import type { ImageSupportInterface } from 'src/image-support/background/types'
import type { CustomList } from '@worldbrain/memex-common/lib/types/core-data-types/client'
import type { FollowedListEntry } from 'src/page-activity-indicator/background/types'
import type { AutoPk } from '@worldbrain/memex-common/lib/storage/types'
import { ContentLocatorType } from '@worldbrain/memex-common/lib/personal-cloud/storage/types'

export function getTemplateDataFetchers({
storageManager,
Expand Down Expand Up @@ -117,7 +118,10 @@ export function getTemplateDataFetchers({
const pageLocators = allLocators.filter(
(l) => l.normalizedUrl === page.url,
)
const mainLocator = pickBestLocator(pageLocators)
const mainLocator = pickBestLocator(pageLocators, {
ignoreUploadLocators: true,
priority: ContentLocatorType.Remote,
})
fullUrl = mainLocator?.originalLocation
? encodeURI(mainLocator.originalLocation)
: page.fullUrl
Expand Down

0 comments on commit 3f7dd6f

Please sign in to comment.