mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 11:48:08 +08:00
FIX: Don't memoize the currentUser in case some plugins use it too early
This commit is contained in:
@ -28,7 +28,6 @@ class PluginApi {
|
|||||||
constructor(version, container) {
|
constructor(version, container) {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
this.container = container;
|
this.container = container;
|
||||||
this._currentUser = container.lookup('current-user:main');
|
|
||||||
this.h = h;
|
this.h = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +36,7 @@ class PluginApi {
|
|||||||
* If the user is not logged in, it will be `null`.
|
* If the user is not logged in, it will be `null`.
|
||||||
**/
|
**/
|
||||||
getCurrentUser() {
|
getCurrentUser() {
|
||||||
return this._currentUser;
|
return this.container.lookup('current-user:main');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user