diff --git a/app/Models/User.php b/app/Models/User.php index ded67026..9c1d8568 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -213,17 +213,18 @@ class User extends Authenticatable implements MustVerifyEmail */ public function getAvatar() { - if ($this->discordUser()->exists()) { - if(@getimagesize($this->discordUser->getAvatar())) { - $avatar = $this->discordUser->getAvatar(); - } else { - $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email))); - } - } else { - $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email))); - } + //TODO loading the images to confirm they exist is causing to much load time. alternative has to be found :) maybe onerror tag on the +// if ($this->discordUser()->exists()) { +// if(@getimagesize($this->discordUser->getAvatar())) { +// $avatar = $this->discordUser->getAvatar(); +// } else { +// $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email))); +// } +// } else { +// $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email))); +// } - return $avatar; + return "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email))); }