This commit is contained in:
Mirco Wittrien 2020-04-10 11:09:58 +02:00
parent 20353c20cf
commit cd9dbdecc9
2 changed files with 3 additions and 4 deletions

View File

@ -2175,14 +2175,13 @@
};
BDFDB.UserUtils = {};
var myDataUser = LibraryModules.CurrentUserStore ? LibraryModules.CurrentUserStore.getCurrentUser() : null;
BDFDB.UserUtils.is = function (user) {
return user && user instanceof BDFDB.DiscordObjects.User;
};
var myDataUser = LibraryModules.CurrentUserStore && LibraryModules.CurrentUserStore.getCurrentUser();
BDFDB.UserUtils.me = new Proxy(myDataUser || {}, {
get: function (list, item) {
if (!myDataUser) myDataUser = LibraryModules.CurrentUserStore.getCurrentUser();
return myDataUser ? myDataUser[item] : null;
return (myDataUser = LibraryModules.CurrentUserStore.getCurrentUser()) != null && myDataUser[item];
}
});
BDFDB.UserUtils.getStatus = function (id = BDFDB.UserUtils.me.id) {

File diff suppressed because one or more lines are too long