@@ -427,7 +427,7 @@ export default function ResultScreen() {
427427 . create ( ( record : any ) => {
428428 record . fullName = "Pengguna Offline" ;
429429 record . totalCompostKg = 0 ;
430- record . createdAt = new Date ( ) . toISOString ( ) ;
430+ record . createdAt = Date . now ( ) ;
431431 } ) ;
432432 profileId = profile . id ;
433433 }
@@ -437,7 +437,7 @@ export default function ResultScreen() {
437437 . create ( ( record : any ) => {
438438 record . userId = profileId ;
439439 record . title = allItems [ 0 ] ?? "Hasil Scan" ;
440- record . status = "Tersimpan " ;
440+ record . status = "Aktif " ;
441441 record . imageUri = result . imageUri ;
442442 record . ratio = result . estimatedRatio || "-" ;
443443 record . progress = 10 ;
@@ -459,8 +459,8 @@ export default function ResultScreen() {
459459 record . carbonItems = result . carbonItems ;
460460 record . nitrogenItems = result . nitrogenItems ;
461461 record . estimatedRatio = result . estimatedRatio ;
462- record . aiInstruction = result . aiInstruction ;
463- record . createdAt = new Date ( ) . toISOString ( ) ;
462+ record . aiInstruction = result . aiInstruction ?? "" ;
463+ record . createdAt = Date . now ( ) ;
464464 } ) ;
465465
466466 await database
@@ -472,11 +472,17 @@ export default function ResultScreen() {
472472 "Hasil analisis ditambahkan dari halaman result." ;
473473 record . isActive = true ;
474474 record . timeLabel = new Date ( ) . toLocaleString ( "id-ID" ) ;
475- record . createdAt = new Date ( ) . toISOString ( ) ;
475+ record . createdAt = Date . now ( ) ;
476476 } ) ;
477477 } ) ;
478478
479- Alert . alert ( "Berhasil" , "Progress berhasil disimpan." ) ;
479+ Alert . alert ( "Berhasil" , "Progress berhasil disimpan." , [
480+ {
481+ text : "Lihat Progress" ,
482+ onPress : ( ) => router . replace ( "/(tabs)/progress" ) ,
483+ } ,
484+ { text : "OK" , style : "cancel" } ,
485+ ] ) ;
480486 } catch ( error ) {
481487 const message =
482488 error instanceof Error ? error . message : "Terjadi kesalahan" ;
0 commit comments