From d79e245d19f7f246322bc657b407198b15cb1b98 Mon Sep 17 00:00:00 2001 From: Wenjing Wang Date: Sun, 12 Nov 2017 12:52:19 -0800 Subject: [PATCH] AMA changes to support disk cache Reviewed By: fred2028 Differential Revision: D6295287 fbshipit-source-id: 70ae7dfba2edb36e758ad0e22916015038108d36 --- .../SwipeableRow/SwipeableListViewDataSource.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource.js b/Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource.js index 506b43416..4fc445496 100644 --- a/Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource.js +++ b/Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource.js @@ -88,6 +88,16 @@ class SwipeableListViewDataSource { return Object.keys(this._dataBlob)[0]; } + getLastRowID(): ?string { + if (this.rowIdentities && this.rowIdentities.length) { + const lastSection = this.rowIdentities[this.rowIdentities.length - 1]; + if (lastSection && lastSection.length) { + return lastSection[lastSection.length - 1]; + } + } + return Object.keys(this._dataBlob)[this._dataBlob.length - 1]; + } + setOpenRowID(rowID: string): SwipeableListViewDataSource { this._previousOpenRowID = this._openRowID; this._openRowID = rowID;