From 0b84dfbb38e742ab0e01420cb3b0f91cfa6b5532 Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Thu, 10 Aug 2017 12:14:33 +0200
Subject: [PATCH] [fix] #1041 Force msPeriod = msWindow in the configuration

---
 app/modules/config.ts | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/app/modules/config.ts b/app/modules/config.ts
index c7dc03d93..a8bebf3e4 100644
--- a/app/modules/config.ts
+++ b/app/modules/config.ts
@@ -3,6 +3,16 @@ import {ConfDTO} from "../lib/dto/ConfDTO"
 
 module.exports = {
   duniter: {
+
+    config: {
+      onLoading: async (conf:ConfDTO) => {
+        conf.msPeriod = conf.msWindow
+      },
+      beforeSave: async (conf:ConfDTO) => {
+        conf.msPeriod = conf.msWindow
+      }
+    },
+
     cli: [{
       name: 'config',
       desc: 'Register configuration in database',
-- 
GitLab