DEV: Don't allow Promise unless imported from "rsvp"
We want to make sure we are using the correct promise implementation so let's lint out the browser version.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import ENV from "discourse-common/config/environment";
|
||||
import { EventTarget } from "rsvp";
|
||||
|
||||
// Track visible elemnts on the screen.
|
||||
const Eyeline = function Eyeline(selector) {
|
||||
@@ -70,6 +71,6 @@ Eyeline.prototype.flushRest = function() {
|
||||
$(this.selector).each((i, elem) => this.trigger("saw", { detail: $(elem) }));
|
||||
};
|
||||
|
||||
RSVP.EventTarget.mixin(Eyeline.prototype);
|
||||
EventTarget.mixin(Eyeline.prototype);
|
||||
|
||||
export default Eyeline;
|
||||
|
||||
@@ -12,6 +12,7 @@ import { findAll } from "discourse/models/login-method";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import { userPath } from "discourse/lib/url";
|
||||
import Composer from "discourse/models/composer";
|
||||
import { EventTarget } from "rsvp";
|
||||
|
||||
function unlessReadOnly(method, message) {
|
||||
return function() {
|
||||
@@ -288,5 +289,5 @@ const ApplicationRoute = DiscourseRoute.extend(OpenComposer, {
|
||||
}
|
||||
});
|
||||
|
||||
RSVP.EventTarget.mixin(ApplicationRoute);
|
||||
EventTarget.mixin(ApplicationRoute);
|
||||
export default ApplicationRoute;
|
||||
|
||||
@@ -6,6 +6,7 @@ import { later } from "@ember/runloop";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import { ID_CONSTRAINT } from "discourse/models/topic";
|
||||
import { EventTarget } from "rsvp";
|
||||
|
||||
let isTransitioning = false,
|
||||
scheduledReplace = null,
|
||||
@@ -313,5 +314,5 @@ const TopicRoute = DiscourseRoute.extend({
|
||||
}
|
||||
});
|
||||
|
||||
RSVP.EventTarget.mixin(TopicRoute);
|
||||
EventTarget.mixin(TopicRoute);
|
||||
export default TopicRoute;
|
||||
|
||||
Reference in New Issue
Block a user