Răsfoiți Sursa

adjust lastId

itizawa 5 ani în urmă
părinte
comite
6d9c46e678
1 a modificat fișierele cu 7 adăugiri și 1 ștergeri
  1. 7 1
      src/client/js/services/PageHistoryContainer.js

+ 7 - 1
src/client/js/services/PageHistoryContainer.js

@@ -70,7 +70,13 @@ export default class PageHistoryContainer extends Container {
     });
 
     const diffOpened = {};
-    const lastId = rev.length - 1;
+
+    let lastId = rev.length - 1;
+
+    // If the number of rev count is the same, the last rev is for diff display, so exclude it.
+    if (rev.length === this.state.pagingLimit + 1) {
+      lastId = rev.length - 2;
+    }
 
     res.data.docs.forEach((revision, i) => {
       const user = revision.author;