Skip to content

Commit

Permalink
fix(bulk): detect selection in gdrive grid (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
rofe authored Dec 16, 2024
1 parent 9fec843 commit 29f7294
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/extension/app/store/bulk.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class BulkStore {
return [...document.querySelectorAll('#drive_main_page [role="row"][aria-selected="true"]')]
// extract file name and type
.map((row) => {
const file = (row.querySelector(':scope div[role="gridcell"] > div > div:nth-child(4)') // grid layout
const file = (row.querySelector(':scope div[role="gridcell"] > div > div:nth-child(2) div[jsname]') // grid layout
|| row.querySelector(':scope div[role="gridcell"] > div:nth-of-type(2)')) // list layout
?.textContent.trim();

Expand Down
12 changes: 7 additions & 5 deletions test/fixtures/content-sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,14 @@ export function mockGdriveFile({ path, type }, viewType = 'list') {
<div>
<div></div>
<div>
<svg><path d="M16 0 0 0 0000.${icon}"></path></svg>
</div>
<div></div>
<div>${filename}</div>
<div>
<svg><path d="M16 0 0 0 0000.${icon}"></path></svg>
</div>
<div></div>
<div>
<div jsname="wuLfrd">${filename}</div>
</div>
</div>
<div></div>
</div>
</div>
`;
Expand Down

0 comments on commit 29f7294

Please sign in to comment.