File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,14 @@ export interface Config {
2121 * return a 404 error.
2222 */
2323 emptyListError : boolean ;
24+ /**
25+ * Whether to update the mdate property when saving an entity.
26+ *
27+ * You should probably only set this to false if you're doing migrations. Some
28+ * things depend on having updated mdates (like conflict detection to avoid
29+ * lost updates).
30+ */
31+ updateMDate : boolean ;
2432 /**
2533 * A function to log info messages. By default, uses the `debug` package.
2634 */
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export default {
2828 cacheThreshold : 4 ,
2929 cacheLimit : 50 ,
3030 emptyListError : false ,
31+ updateMDate : true ,
3132 debugInfo : ( source , message ) => {
3233 getDebuggers ( source ) . info ( message ) ;
3334 } ,
Original file line number Diff line number Diff line change @@ -1038,7 +1038,9 @@ export default abstract class NymphDriver {
10381038 | null = null ,
10391039 ) {
10401040 // Get a modified date.
1041- const mdate = Date . now ( ) ;
1041+ const mdate = this . nymph . config . updateMDate
1042+ ? Date . now ( )
1043+ : ( entity . mdate ?? Date . now ( ) ) ;
10421044 const tags = difference ( entity . tags , [ '' ] ) ;
10431045 const data = entity . $getData ( ) ;
10441046 const sdata = entity . $getSData ( ) ;
You can’t perform that action at this time.
0 commit comments