File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
src/app/shared/repositories/proof Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ### Fixed
11+
12+ 1 . Fix incorrect asset date display when viewing restored data offline [ #3336 ] ( https://github.com/numbersprotocol/capture-lite/issues/3336 )
13+
1014## [ 0.101.1] - 2025-03-21
1115
1216### Fixed
Original file line number Diff line number Diff line change @@ -61,11 +61,12 @@ export class Proof {
6161 */
6262 get uploadedAtOrTimestamp ( ) {
6363 const MILLISECONDS_PER_SECOND = 1000 ;
64- const LENGTH_IN_MILLISECONDS = 13 ;
64+ const MILLISECONDS_THRESHOLD = 10000000000 ; // 10^10, timestamps after March 2001
6565
6666 // convert timestamp to milliseconds if needed
67+ // Use threshold-based approach instead of string length to determine if timestamp is in milliseconds
6768 const proofTimestampInMilliseconds =
68- this . timestamp . toString ( ) . length === LENGTH_IN_MILLISECONDS
69+ this . timestamp > MILLISECONDS_THRESHOLD
6970 ? this . timestamp
7071 : this . timestamp * MILLISECONDS_PER_SECOND ;
7172
@@ -80,7 +81,8 @@ export class Proof {
8081 * Note: After restoring or syncing with the backend assets, the timestamp will be in seconds.
8182 * For more details, refer to https://github.com/numbersprotocol/storage-backend/issues/976
8283 *
83- * Note: Milliseconds are 13 digits long, while seconds are 10 digits long.
84+ * Note: Milliseconds are typically 13 digits long (after 2001), while seconds are typically 10 digits long.
85+ * We use a threshold-based approach to detect and convert between these formats.
8486 */
8587 get timestamp ( ) {
8688 return this . truth . timestamp ;
You can’t perform that action at this time.
0 commit comments