Skip to content

Commit

Permalink
Fix #6 - observe both columns when loading more images
Browse files Browse the repository at this point in the history
  • Loading branch information
Talal-A committed Jan 4, 2025
1 parent f805ae5 commit 53eb13a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,16 @@ class ImageSelectorModal extends Modal {
// Get the width of the viewport
const totalWidth = contentEl.innerWidth;

const imageDiv = contentEl.createDiv({cls: 'row'});
const left = imageDiv.createDiv({cls: 'column'});
const right = imageDiv.createDiv({cls: 'column'});
const bottomDiv = contentEl.createDiv();
const row = contentEl.createDiv({cls: 'row'});
const leftImageDiv = row.createDiv({cls: 'column'});
const rightImageDiv = row.createDiv({cls: 'column'});
const left = leftImageDiv.createDiv();
const right = rightImageDiv.createDiv();
const leftBottom = leftImageDiv.createDiv();
const rightBottom = rightImageDiv.createDiv();
let observer = new IntersectionObserver(() => {
const startIndex = this.page;
let endIndex = this.page + 4;
let endIndex = this.page + 10;
if (endIndex > cachedResult.json['assets'].length) {
endIndex = cachedResult.json['assets'].length;
}
Expand All @@ -123,7 +126,8 @@ class ImageSelectorModal extends Modal {
}

}, {threshold: [0.1]});
observer.observe(bottomDiv);
observer.observe(leftBottom);
observer.observe(rightBottom);
}

onClose() {
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "immich",
"name": "Immich",
"version": "0.1.1",
"version": "0.1.2",
"minAppVersion": "0.15.0",
"description": "Link your Immich images within your vault.",
"author": "Talal Abou Haiba",
Expand Down

0 comments on commit 53eb13a

Please sign in to comment.