@@ -477,8 +477,9 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p
477
477
onyxMethod : Onyx . METHOD . MERGE ,
478
478
key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
479
479
value : {
480
- isLoadingReportActions : true ,
481
- isLoadingMoreReportActions : false ,
480
+ isLoadingInitialReportActions : true ,
481
+ isLoadingOlderReportActions : false ,
482
+ isLoadingNewerReportActions : false ,
482
483
} ,
483
484
} ,
484
485
] ;
@@ -501,7 +502,7 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p
501
502
onyxMethod : Onyx . METHOD . MERGE ,
502
503
key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
503
504
value : {
504
- isLoadingReportActions : false ,
505
+ isLoadingInitialReportActions : false ,
505
506
} ,
506
507
} ,
507
508
] ;
@@ -511,7 +512,7 @@ function openReport(reportID, participantLoginList = [], newReportObject = {}, p
511
512
onyxMethod : Onyx . METHOD . MERGE ,
512
513
key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
513
514
value : {
514
- isLoadingReportActions : false ,
515
+ isLoadingInitialReportActions : false ,
515
516
} ,
516
517
} ,
517
518
] ;
@@ -737,8 +738,9 @@ function reconnect(reportID) {
737
738
onyxMethod : Onyx . METHOD . MERGE ,
738
739
key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
739
740
value : {
740
- isLoadingReportActions : true ,
741
- isLoadingMoreReportActions : false ,
741
+ isLoadingInitialReportActions : true ,
742
+ isLoadingNewerReportActions : false ,
743
+ isLoadingOlderReportActions : false ,
742
744
} ,
743
745
} ,
744
746
] ,
@@ -747,7 +749,7 @@ function reconnect(reportID) {
747
749
onyxMethod : Onyx . METHOD . MERGE ,
748
750
key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
749
751
value : {
750
- isLoadingReportActions : false ,
752
+ isLoadingInitialReportActions : false ,
751
753
} ,
752
754
} ,
753
755
] ,
@@ -756,7 +758,7 @@ function reconnect(reportID) {
756
758
onyxMethod : Onyx . METHOD . MERGE ,
757
759
key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
758
760
value : {
759
- isLoadingReportActions : false ,
761
+ isLoadingInitialReportActions : false ,
760
762
} ,
761
763
} ,
762
764
] ,
@@ -771,9 +773,9 @@ function reconnect(reportID) {
771
773
* @param {String } reportID
772
774
* @param {String } reportActionID
773
775
*/
774
- function readOldestAction ( reportID , reportActionID ) {
776
+ function getOlderActions ( reportID , reportActionID ) {
775
777
API . read (
776
- 'ReadOldestAction ' ,
778
+ 'GetOlderActions ' ,
777
779
{
778
780
reportID,
779
781
reportActionID,
@@ -784,7 +786,7 @@ function readOldestAction(reportID, reportActionID) {
784
786
onyxMethod : Onyx . METHOD . MERGE ,
785
787
key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
786
788
value : {
787
- isLoadingMoreReportActions : true ,
789
+ isLoadingOlderReportActions : true ,
788
790
} ,
789
791
} ,
790
792
] ,
@@ -793,7 +795,7 @@ function readOldestAction(reportID, reportActionID) {
793
795
onyxMethod : Onyx . METHOD . MERGE ,
794
796
key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
795
797
value : {
796
- isLoadingMoreReportActions : false ,
798
+ isLoadingOlderReportActions : false ,
797
799
} ,
798
800
} ,
799
801
] ,
@@ -802,7 +804,53 @@ function readOldestAction(reportID, reportActionID) {
802
804
onyxMethod : Onyx . METHOD . MERGE ,
803
805
key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
804
806
value : {
805
- isLoadingMoreReportActions : false ,
807
+ isLoadingOlderReportActions : false ,
808
+ } ,
809
+ } ,
810
+ ] ,
811
+ } ,
812
+ ) ;
813
+ }
814
+
815
+ /**
816
+ * Gets the newer actions that have not been read yet.
817
+ * Normally happens when you are not located at the bottom of the list and scroll down on a chat.
818
+ *
819
+ * @param {String } reportID
820
+ * @param {String } reportActionID
821
+ */
822
+ function getNewerActions ( reportID , reportActionID ) {
823
+ API . read (
824
+ 'GetNewerActions' ,
825
+ {
826
+ reportID,
827
+ reportActionID,
828
+ } ,
829
+ {
830
+ optimisticData : [
831
+ {
832
+ onyxMethod : Onyx . METHOD . MERGE ,
833
+ key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
834
+ value : {
835
+ isLoadingNewerReportActions : true ,
836
+ } ,
837
+ } ,
838
+ ] ,
839
+ successData : [
840
+ {
841
+ onyxMethod : Onyx . METHOD . MERGE ,
842
+ key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
843
+ value : {
844
+ isLoadingNewerReportActions : false ,
845
+ } ,
846
+ } ,
847
+ ] ,
848
+ failureData : [
849
+ {
850
+ onyxMethod : Onyx . METHOD . MERGE ,
851
+ key : `${ ONYXKEYS . COLLECTION . REPORT_METADATA } ${ reportID } ` ,
852
+ value : {
853
+ isLoadingNewerReportActions : false ,
806
854
} ,
807
855
} ,
808
856
] ,
@@ -2411,7 +2459,6 @@ export {
2411
2459
expandURLPreview ,
2412
2460
markCommentAsUnread ,
2413
2461
readNewestAction ,
2414
- readOldestAction ,
2415
2462
openReport ,
2416
2463
openReportFromDeepLink ,
2417
2464
navigateToAndOpenReport ,
@@ -2436,6 +2483,8 @@ export {
2436
2483
getReportPrivateNote ,
2437
2484
clearPrivateNotesError ,
2438
2485
hasErrorInPrivateNotes ,
2486
+ getOlderActions ,
2487
+ getNewerActions ,
2439
2488
openRoomMembersPage ,
2440
2489
savePrivateNotesDraft ,
2441
2490
getDraftPrivateNote ,
0 commit comments