From 60a7ebfe9cc454bafff0f2530e06c5a81be9fb6f Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 5 Oct 2023 11:22:04 +0200 Subject: [PATCH] DEV: adds support for userHasBeenActive (#249) --- .discourse-compatibility | 1 + .../discourse/widgets/discourse-reactions-actions.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.discourse-compatibility b/.discourse-compatibility index 69a7e0d..9ba0df5 100644 --- a/.discourse-compatibility +++ b/.discourse-compatibility @@ -1,3 +1,4 @@ +< 3.2.0.beta2-dev: 7995e87b6c00166553b2fe62f4098624492180a0 3.1.999: 643f807a3a2195f08211064301f0350d9f51604f 3.1.0.beta2: 5484d64d880ce4ba6fba22446d54195a447cd091 2.9.0.beta12: 8f6895403e32e37d5abcd9b3fc1c8141315589e4 diff --git a/assets/javascripts/discourse/widgets/discourse-reactions-actions.js b/assets/javascripts/discourse/widgets/discourse-reactions-actions.js index 2c4bc13..0a495f9 100644 --- a/assets/javascripts/discourse/widgets/discourse-reactions-actions.js +++ b/assets/javascripts/discourse/widgets/discourse-reactions-actions.js @@ -264,7 +264,7 @@ export default createWidget("discourse-reactions-actions", { (this.attrs.post.current_user_reaction.can_undo && this.attrs.post.likeAction.canToggle) ) { - if (this.capabilities.canVibrate) { + if (this.capabilities.userHasBeenActive && this.capabilities.canVibrate) { navigator.vibrate(VIBRATE_DURATION); } @@ -458,7 +458,7 @@ export default createWidget("discourse-reactions-actions", { return; } - if (this.capabilities.canVibrate) { + if (this.capabilities.userHasBeenActive && this.capabilities.canVibrate) { navigator.vibrate(VIBRATE_DURATION); }