Browse Source

Fixed issue with initials profile picture if no name is set

Kristian Vos 3 years ago
parent
commit
03ef75eedf

+ 1 - 1
frontend/src/pages/Admin/tabs/Users.vue

@@ -24,7 +24,7 @@
 						<td>
 							<profile-picture
 								:avatar="user.avatar"
-								:name="user.name"
+								:name="user.name ? user.name : user.username"
 							/>
 						</td>
 						<td>{{ user._id }}</td>

+ 4 - 1
frontend/src/pages/Profile/index.vue

@@ -9,7 +9,10 @@
 		<div class="container">
 			<div class="info-section">
 				<div class="picture-name-row">
-					<profile-picture :avatar="user.avatar" :name="user.name" />
+					<profile-picture
+						:avatar="user.avatar"
+						:name="user.name ? user.name : user.username"
+					/>
 					<div>
 						<div class="name-role-row">
 							<p class="name">{{ user.name }}</p>

+ 5 - 1
frontend/src/pages/Settings/tabs/Profile.vue

@@ -15,7 +15,11 @@
 			<div id="avatar-selection-inner-container">
 				<profile-picture
 					:avatar="modifiedUser.avatar"
-					:name="modifiedUser.name"
+					:name="
+						modifiedUser.name
+							? modifiedUser.name
+							: modifiedUser.username
+					"
 				/>
 				<div class="select">
 					<select v-model="modifiedUser.avatar.type">

+ 1 - 1
frontend/src/pages/Station/Sidebar/Users.vue

@@ -44,7 +44,7 @@
 					>
 						<profile-picture
 							:avatar="user.avatar"
-							:name="user.name"
+							:name="user.name ? user.name : user.username"
 						/>
 
 						{{ user.username }}