mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: correctly checks user activation on use (#23793)
We can't have it computed only at start of the application as the state wouldn't most likely be false at this point in time.
This commit is contained in:
@@ -4,7 +4,6 @@ import { getOwner } from "@ember/application";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import discourseLater from "discourse-common/lib/later";
|
||||
import { action } from "@ember/object";
|
||||
import { isTesting } from "discourse-common/config/environment";
|
||||
import { inject as service } from "@ember/service";
|
||||
import and from "truth-helpers/helpers/and";
|
||||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
@@ -142,7 +141,7 @@ export default class ChatMessageActionsMobile extends Component {
|
||||
fadeAndVibrate() {
|
||||
discourseLater(this.#addFadeIn.bind(this));
|
||||
|
||||
if (this.capabilities.canVibrate && !isTesting()) {
|
||||
if (this.capabilities.userHasBeenActive && this.capabilities.canVibrate) {
|
||||
navigator.vibrate(5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import { BookmarkFormData } from "discourse/lib/bookmark";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { isTesting } from "discourse-common/config/environment";
|
||||
import { clipboardCopy } from "discourse/lib/utilities";
|
||||
import ChatMessageReaction, {
|
||||
REACTIONS,
|
||||
@@ -284,7 +283,7 @@ export default class ChatMessageInteractor {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.capabilities.canVibrate && !isTesting()) {
|
||||
if (this.capabilities.userHasBeenActive && this.capabilities.canVibrate) {
|
||||
navigator.vibrate(5);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user