File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
atcoder-problems-frontend/src/database Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,13 @@ const fetchNewSubmissions = async (
33
33
fromSecond : number
34
34
) : Promise < Submission [ ] > => {
35
35
const newSubmissions = [ ] as Submission [ ] ;
36
- // eslint-disable-next-line no-constant-condition
37
- while ( true ) {
36
+ for ( ; ; ) {
38
37
const fetched = await fetchPartialUserSubmissions ( userId , fromSecond ) ;
39
38
if ( fetched . length === 0 ) {
40
39
break ;
41
40
}
42
41
newSubmissions . push ( ...fetched ) ;
43
- newSubmissions . sort ( ( a , b ) => a . id - b . id ) ;
42
+ newSubmissions . sort ( ( a , b ) => a . epoch_second - b . epoch_second ) ;
44
43
fromSecond = newSubmissions [ newSubmissions . length - 1 ] . epoch_second + 1 ;
45
44
}
46
45
return newSubmissions ;
@@ -57,7 +56,7 @@ export const fetchSubmissionsFromDatabaseAndServer = async (userId: UserId) => {
57
56
const submissions = await loadAllData < Submission [ ] > ( db , OBJECT_STORE ) ;
58
57
59
58
console . log ( `Loaded ${ submissions . length } submissions from DB` ) ;
60
- submissions . sort ( ( a , b ) => a . id - b . id ) ;
59
+ submissions . sort ( ( a , b ) => a . epoch_second - b . epoch_second ) ;
61
60
62
61
const lastSecond =
63
62
submissions . length > 0
You can’t perform that action at this time.
0 commit comments