Skip to content

Commit

Permalink
- load images eagerly
Browse files Browse the repository at this point in the history
- fix parsing images in extension
  • Loading branch information
Rustem Mussabekov committed Feb 13, 2024
1 parent b4eb953 commit 774bc58
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "5.6.19",
"version": "5.6.20",
"description": "",
"author": "",
"license": "ISC",
Expand Down
1 change: 0 additions & 1 deletion src/co/bookmarks/item/cover/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export default class BookmarkItemCover extends React.PureComponent {
width={width}
height={height}
alt=' '
loading={view=='masonry' ? 'eager' : 'lazy'}
{...etc}
src={uri && `${uri}?mode=${mode}&fill=solid&width=${width||''}&ar=${ar||''}&dpr=${dpr[view]||dpr.default}`}
//type='image/jpeg'
Expand Down
3 changes: 1 addition & 2 deletions src/co/picker/image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ export default class PickerImage extends React.Component {
autoFocus={this.props.selected == link}
onClick={()=>this.onLink(link)}>
<img
src={`${getThumbUri(link)}?mode=crop&width=128&height=96&dpr=${window.devicePixelRatio||1}`}
loading='lazy' />
src={`${getThumbUri(link)}?mode=crop&width=128&height=96&dpr=${window.devicePixelRatio||1}`} />
</button>

render() {
Expand Down
6 changes: 5 additions & 1 deletion src/target/extension/getMeta/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,16 @@ function getItem() {
...grabImages()
].filter((value, index, self)=>self.indexOf(value) === index)

if (images.length)
if (images.length) {
item.media = images.map(link=>({
type: 'image',
link
}))

if (!item.cover)
item.cover = images[0]
}

//limit length
if (item.title && item.title.length)
item.title = item.title.substr(0, 1000)
Expand Down

0 comments on commit 774bc58

Please sign in to comment.