FIX: More `Promise` uses that were not imported
This commit is contained in:
parent
46841888b7
commit
9b60900b8d
|
@ -11,6 +11,7 @@ import GroupHistory from "discourse/models/group-history";
|
|||
import RestModel from "discourse/models/rest";
|
||||
import Topic from "discourse/models/topic";
|
||||
import User from "discourse/models/user";
|
||||
import { Promise } from "rsvp";
|
||||
|
||||
const Group = RestModel.extend({
|
||||
user_count: 0,
|
||||
|
@ -38,7 +39,7 @@ const Group = RestModel.extend({
|
|||
|
||||
findMembers(params, refresh) {
|
||||
if (isEmpty(this.name) || !this.can_see_members) {
|
||||
return Ember.RSVP.Promise.reject();
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
if (refresh) {
|
||||
|
@ -73,7 +74,7 @@ const Group = RestModel.extend({
|
|||
|
||||
findRequesters(params, refresh) {
|
||||
if (isEmpty(this.name) || !this.can_see_members) {
|
||||
return Ember.RSVP.Promise.reject();
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
if (refresh) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import { getRegister } from "discourse-common/lib/get-owner";
|
|||
import { underscore } from "@ember/string";
|
||||
import { set } from "@ember/object";
|
||||
import Category from "discourse/models/category";
|
||||
import { Promise } from "rsvp";
|
||||
|
||||
let _identityMap;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ import {
|
|||
import hbs from "discourse/widgets/hbs-compiler";
|
||||
import { relativeAgeMediumSpan } from "discourse/lib/formatter";
|
||||
import { prioritizeNameInUx } from "discourse/lib/settings";
|
||||
import { Promise } from "rsvp";
|
||||
|
||||
function transformWithCallbacks(post) {
|
||||
let transformed = transformBasicPost(post);
|
||||
|
|
|
@ -2,6 +2,7 @@ import Session from "discourse/models/session";
|
|||
import { createWidget } from "discourse/widgets/widget";
|
||||
import { h } from "virtual-dom";
|
||||
import { headerHeight } from "discourse/components/site-header";
|
||||
import { Promise } from "rsvp";
|
||||
|
||||
const AVERAGE_ITEM_HEIGHT = 55;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import QuickAccessPanel from "discourse/widgets/quick-access-panel";
|
||||
import { createWidgetFrom } from "discourse/widgets/widget";
|
||||
import { Promise } from "rsvp";
|
||||
|
||||
createWidgetFrom(QuickAccessPanel, "quick-access-profile", {
|
||||
buildKey: () => "quick-access-profile",
|
||||
|
|
|
@ -21,14 +21,14 @@ export default {
|
|||
**/
|
||||
getAndRemove(key, finder) {
|
||||
if (this.data[key]) {
|
||||
var promise = Promise.resolve(this.data[key]);
|
||||
let promise = Promise.resolve(this.data[key]);
|
||||
delete this.data[key];
|
||||
return promise;
|
||||
}
|
||||
|
||||
if (finder) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var result = finder();
|
||||
let result = finder();
|
||||
|
||||
// If the finder returns a promise, we support that too
|
||||
if (result && result.then) {
|
||||
|
|
Loading…
Reference in New Issue