Skip to content

Commit 0b2e51e

Browse files
authored
fix: bulk selection in gdrive broken (#771)
1 parent c972931 commit 0b2e51e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/extension/app/store/bulk.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ export class BulkStore {
200200
* @returns {BulkSelection} The selection
201201
*/
202202
#getGoogleDriveBulkSelection(document) {
203-
return [...document.querySelectorAll('#drive_main_page [aria-selected="true"]')]
203+
return [
204+
...document.querySelectorAll('div[role="main"] [aria-selected="true"]'),
205+
...document.querySelectorAll('#drive_main_page [aria-selected="true"]'), // legacy
206+
]
204207
// extract file name and type
205208
.map((row) => {
206209
const file = (row.querySelector(':scope td div[data-id] > span > strong') // list layout
@@ -253,6 +256,7 @@ export class BulkStore {
253256
this.setSelection(this.appStore.isSharePointFolder(location)
254257
? this.#getSharepointBulkSelection(document)
255258
: this.#getGoogleDriveBulkSelection(document));
259+
console.log('bulk selection', JSON.stringify(this.selection, null, 2));
256260
}
257261

258262
/**

test/fixtures/content-sources.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const DEFAULT_SHAREPOINT_BULK_SELECTION = [
4646
*/
4747
export function mockGdriveRoot() {
4848
const root = document.createElement('div');
49-
root.id = 'drive_main_page';
49+
root.setAttribute('role', 'main');
5050
return root;
5151
}
5252

0 commit comments

Comments
 (0)