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 (
3333 fromSecond : number
3434) : Promise < Submission [ ] > => {
3535 const newSubmissions = [ ] as Submission [ ] ;
36- // eslint-disable-next-line no-constant-condition
37- while ( true ) {
36+ for ( ; ; ) {
3837 const fetched = await fetchPartialUserSubmissions ( userId , fromSecond ) ;
3938 if ( fetched . length === 0 ) {
4039 break ;
4140 }
4241 newSubmissions . push ( ...fetched ) ;
43- newSubmissions . sort ( ( a , b ) => a . id - b . id ) ;
42+ newSubmissions . sort ( ( a , b ) => a . epoch_second - b . epoch_second ) ;
4443 fromSecond = newSubmissions [ newSubmissions . length - 1 ] . epoch_second + 1 ;
4544 }
4645 return newSubmissions ;
@@ -57,7 +56,7 @@ export const fetchSubmissionsFromDatabaseAndServer = async (userId: UserId) => {
5756 const submissions = await loadAllData < Submission [ ] > ( db , OBJECT_STORE ) ;
5857
5958 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 ) ;
6160
6261 const lastSecond =
6362 submissions . length > 0
You can’t perform that action at this time.
0 commit comments