FIX: Use Ember's debounce on stable. (#96)
We need to wrap the new debounce function inside a try block to avoid throwing a "module not found" exception.
This commit is contained in:
parent
4f33c22344
commit
50e62d84e8
|
@ -2,8 +2,7 @@ import {
|
||||||
default as computed,
|
default as computed,
|
||||||
observes,
|
observes,
|
||||||
} from "discourse-common/utils/decorators";
|
} from "discourse-common/utils/decorators";
|
||||||
import discourseDebounce from "discourse-common/lib/debounce";
|
import { debounce } from "@ember/runloop";
|
||||||
import debounce from "@ember/runloop";
|
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -116,7 +115,11 @@ export default Ember.Component.extend({
|
||||||
@observes("filter")
|
@observes("filter")
|
||||||
triggerFilter() {
|
triggerFilter() {
|
||||||
// TODO: Use discouseDebounce after the 2.7 release.
|
// TODO: Use discouseDebounce after the 2.7 release.
|
||||||
let debounceFunc = discourseDebounce || debounce;
|
let debounceFunc = debounce;
|
||||||
|
|
||||||
|
try {
|
||||||
|
debounceFunc = require("discourse-common/lib/debounce").default;
|
||||||
|
} catch (_) {}
|
||||||
|
|
||||||
debounceFunc(
|
debounceFunc(
|
||||||
this,
|
this,
|
||||||
|
|
Loading…
Reference in New Issue