From 28a037bdd91dc13f8aceac2f00e26ae7a8a14f32 Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 18 Jun 2019 17:04:24 -0700 Subject: [PATCH 1/2] Fix timestamp randomly stopped from updating --- CHANGELOG.md | 1 + packages/component/src/Utils/TimeAgo.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7fe847bb8..9c9e0f1b69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix [#2078](https://github.com/microsoft/BotFramework-WebChat/issues/2078). Update Localization files for tr-TR by [@vefacaglar](https://github.com/vefacaglar) - Fix [#2069](https://github.com/microsoft/BotFramework-WebChat/issues/2069). Fixed markdown renderer issue in Playground, by [@tdurnford](https://github.com/tdurnford) in PR[#2073](https://github.com/microsoft/BotFramework-WebChat/pull/2073) - Fix [#1971](https://github.com/Microsoft/BotFramework-WebChat/issues/1971). Fix mobile UX of Sendbox, SendButton, and SuggestedAction focus, by [@corinagum](https://github.com/corinagum) in PR [#2087](https://github.com/Microsoft/BotFramework-WebChat/pull/2087) +- Fix [#1627](https://github.com/Microsoft/BotFramework-WebChat/issues/1627). Fixed timestamps randomly stopped from updating, by [@compulim](https://github.com/compulim) in PR [#XXX](https://github.com/Microsoft/BotFramework-WebChat/pull/XXX) ## [4.4.1] - 2019-05-02 diff --git a/packages/component/src/Utils/TimeAgo.js b/packages/component/src/Utils/TimeAgo.js index 82aeee16e4..51b393e2a2 100644 --- a/packages/component/src/Utils/TimeAgo.js +++ b/packages/component/src/Utils/TimeAgo.js @@ -11,7 +11,7 @@ function nextTimer(date) { const time = new Date(date).getTime(); const now = Date.now(); - return time > now ? time : Math.ceil((now - time) / TIMER_INTERVAL) * TIMER_INTERVAL + time; + return time > now ? time : now + TIMER_INTERVAL - ((now - time) % TIMER_INTERVAL); } function getStateFromProps({ language, value }) { From 195ac2d14503265b492688df6cbdc9d8e68259bc Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 18 Jun 2019 17:12:07 -0700 Subject: [PATCH 2/2] Update entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c9e0f1b69..825c7b1ed4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,7 +56,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix [#2078](https://github.com/microsoft/BotFramework-WebChat/issues/2078). Update Localization files for tr-TR by [@vefacaglar](https://github.com/vefacaglar) - Fix [#2069](https://github.com/microsoft/BotFramework-WebChat/issues/2069). Fixed markdown renderer issue in Playground, by [@tdurnford](https://github.com/tdurnford) in PR[#2073](https://github.com/microsoft/BotFramework-WebChat/pull/2073) - Fix [#1971](https://github.com/Microsoft/BotFramework-WebChat/issues/1971). Fix mobile UX of Sendbox, SendButton, and SuggestedAction focus, by [@corinagum](https://github.com/corinagum) in PR [#2087](https://github.com/Microsoft/BotFramework-WebChat/pull/2087) -- Fix [#1627](https://github.com/Microsoft/BotFramework-WebChat/issues/1627). Fixed timestamps randomly stopped from updating, by [@compulim](https://github.com/compulim) in PR [#XXX](https://github.com/Microsoft/BotFramework-WebChat/pull/XXX) +- Fix [#1627](https://github.com/Microsoft/BotFramework-WebChat/issues/1627). Fixed timestamps randomly stopped from updating, by [@compulim](https://github.com/compulim) in PR [#2090](https://github.com/Microsoft/BotFramework-WebChat/pull/2090) ## [4.4.1] - 2019-05-02