diff --git a/jslib b/jslib index d4c2b20a25..d8f9177c03 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit d4c2b20a2594fcac1fdabf312b7289657b4af0c8 +Subproject commit d8f9177c03549667cf6d1e5f30536d010acc7b7d diff --git a/package-lock.json b/package-lock.json index 672e6b9427..8939f9ed45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8925,9 +8925,9 @@ "dev": true }, "ngx-infinite-scroll": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ngx-infinite-scroll/-/ngx-infinite-scroll-6.0.1.tgz", - "integrity": "sha512-20WcD+3Qh3O0IEFyIjt55JPTKw5W1hAxERXMUDgGDRveS3IBpBxv2DuX5vuHG/bNGC+WoTDlNR/XXScNNicRpw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/ngx-infinite-scroll/-/ngx-infinite-scroll-7.0.1.tgz", + "integrity": "sha512-be9DAAuabV7VGI06/JUnS6pXC6mcBOzA4+SBCwOcP9WwJ2r5GjdZyOa34ls9hi1MnCOj3zrXLvPKQ/UDp6csIw==", "requires": { "opencollective": "^1.0.3" } diff --git a/package.json b/package.json index 7e3fbfcb74..a82a6a5af3 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "font-awesome": "4.7.0", "lunr": "2.3.3", "mousetrap": "1.6.2", - "ngx-infinite-scroll": "6.0.1", + "ngx-infinite-scroll": "7.0.1", "node-forge": "0.7.6", "papaparse": "4.6.0", "rxjs": "6.3.3", diff --git a/src/popup/vault/ciphers.component.html b/src/popup/vault/ciphers.component.html index f9f92cf242..52a6b5d143 100644 --- a/src/popup/vault/ciphers.component.html +++ b/src/popup/vault/ciphers.component.html @@ -53,7 +53,7 @@ - +
@@ -63,7 +63,7 @@
-
diff --git a/src/popup/vault/ciphers.component.ts b/src/popup/vault/ciphers.component.ts index a5d9b04ef8..1313d2976c 100644 --- a/src/popup/vault/ciphers.component.ts +++ b/src/popup/vault/ciphers.component.ts @@ -48,15 +48,12 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On folderId: string = null; collectionId: string = null; type: CipherType = null; - pagedCiphers: CipherView[] = []; nestedFolders: Array>; nestedCollections: Array>; searchTypeSearch = false; - private didScroll = false; private selectedTimeout: number; private preventSelected = false; - private pageSize = 100; private applySavedState = true; constructor(searchService: SearchService, private route: ActivatedRoute, @@ -67,7 +64,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On private folderService: FolderService, private collectionService: CollectionService, private analytics: Angulartics2, private platformUtilsService: PlatformUtilsService) { super(searchService); - this.pageSize = platformUtilsService.isEdge() ? 25 : 100; + this.pageSize = platformUtilsService.isEdge() ? 25 : 10; this.applySavedState = (window as any).previousPopupUrl != null && !(window as any).previousPopupUrl.startsWith('/ciphers'); } @@ -124,7 +121,6 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On await this.load(); } - this.loadMore(); if (this.applySavedState) { this.state = (await this.stateService.get(ComponentId)) || {}; if (this.state.searchText) { @@ -214,41 +210,12 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On this.location.back(); } - loadMore() { - if (this.ciphers.length <= this.pageSize) { - return; - } - - const pagedLength = this.pagedCiphers.length; - if (this.ciphers.length > pagedLength) { - this.pagedCiphers = this.pagedCiphers.concat(this.ciphers.slice(pagedLength, pagedLength + this.pageSize)); - } - this.didScroll = this.pagedCiphers.length > this.pageSize; - } - showGroupings() { return !this.isSearching() && ((this.nestedFolders && this.nestedFolders.length) || (this.nestedCollections && this.nestedCollections.length)); } - isSearching() { - return !this.searchPending && this.searchService.isSearchable(this.searchText); - } - - isPaging() { - const searching = this.isSearching(); - if (searching && this.didScroll) { - this.resetPaging(); - } - return !searching && this.ciphers.length > this.pageSize; - } - - async resetPaging() { - this.pagedCiphers = []; - this.loadMore(); - } - private async saveState() { this.state = { scrollY: this.popupUtils.getContentScrollY(window),