Browse Source

fix(User List): let logged-out user know if they are alone

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 4 years ago
parent
commit
19ff2f826e
1 changed files with 14 additions and 12 deletions
  1. 14 12
      frontend/src/pages/Station/components/Sidebar/Users.vue

+ 14 - 12
frontend/src/pages/Station/components/Sidebar/Users.vue

@@ -5,24 +5,26 @@
 		<transition-group name="notification-box">
 			<h6
 				class="has-text-centered"
-				v-if="users && users.loggedOut.length > 0"
-				key="logged-out-users"
-			>
-				{{ users.loggedOut.length }}
-				{{ users.loggedOut.length > 1 ? "users are" : "user is" }}
-				logged-out.
-			</h6>
-			<h6
-				class="has-text-centered"
-				v-else-if="
+				v-if="
 					users &&
-						users.loggedIn.length === 1 &&
-						users.loggedOut.length === 0
+						((users.loggedIn.length === 1 &&
+							users.loggedOut.length === 0) ||
+							(users.loggedIn.length === 0 &&
+								users.loggedOut.length === 1))
 				"
 				key="only-me"
 			>
 				It's just you in the station!
 			</h6>
+			<h6
+				class="has-text-centered"
+				v-else-if="users && users.loggedOut.length > 0"
+				key="logged-out-users"
+			>
+				{{ users.loggedOut.length }}
+				{{ users.loggedOut.length > 1 ? "users are" : "user is" }}
+				logged-out.
+			</h6>
 		</transition-group>
 
 		<aside class="menu">