mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 20:03:15 +08:00
DEV: Don't try to vibrate in test mode (#17405)
It ends up just triggering an error: ``` [Intervention] Blocked call to navigator.vibrate because user hasn't tapped on the frame or any embedded frame yet: https://www.chromestatus.com/feature/5644273861001216. ```
This commit is contained in:
parent
9365d4e86a
commit
f19f804525
|
@ -10,6 +10,7 @@ import {
|
|||
NO_REMINDER_ICON,
|
||||
WITH_REMINDER_ICON,
|
||||
} from "discourse/models/bookmark";
|
||||
import { isTesting } from "discourse-common/config/environment";
|
||||
|
||||
const LIKE_ACTION = 2;
|
||||
const VIBRATE_DURATION = 5;
|
||||
|
@ -721,7 +722,7 @@ export default createWidget("post-menu", {
|
|||
return this.sendWidgetAction("showLogin");
|
||||
}
|
||||
|
||||
if (this.capabilities.canVibrate) {
|
||||
if (this.capabilities.canVibrate && !isTesting()) {
|
||||
navigator.vibrate(VIBRATE_DURATION);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user