mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Revert "DEV: Discourse.User
has been deprecated since 2.6"
This reverts commit 3edf24437a
.
Too many plugins rely on this right now and need to be updated.
This commit is contained in:
parent
3edf24437a
commit
5c07e544af
@ -22,6 +22,7 @@ import UserDraftsStream from "discourse/models/user-drafts-stream";
|
||||
import UserPostsStream from "discourse/models/user-posts-stream";
|
||||
import UserStream from "discourse/models/user-stream";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import deprecated from "discourse-common/lib/deprecated";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { emojiUnescape } from "discourse/lib/text";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
@ -1119,4 +1120,20 @@ User.reopenClass(Singleton, {
|
||||
},
|
||||
});
|
||||
|
||||
if (typeof Discourse !== "undefined") {
|
||||
let warned = false;
|
||||
Object.defineProperty(Discourse, "User", {
|
||||
get() {
|
||||
if (!warned) {
|
||||
deprecated("Import the User class instead of using User", {
|
||||
since: "2.4.0",
|
||||
dropFrom: "2.6.0",
|
||||
});
|
||||
warned = true;
|
||||
}
|
||||
return User;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export default User;
|
||||
|
Loading…
Reference in New Issue
Block a user