Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Just display first and last initial if the extracted inital is more than 2

Tianzhou Chen06f11667d47e
diff --git a/frontend/src/bbkit/BBAvatar.vue b/frontend/src/bbkit/BBAvatar.vue
index df04e5ee19..9448d30b7c 100644
--- a/frontend/src/bbkit/BBAvatar.vue
+++ b/frontend/src/bbkit/BBAvatar.vue
@@ -67,8 +67,12 @@ export default {
}
}
}
- initials = initials.substr(0, 3).toUpperCase();
- return initials;
+ if (initials.length <= 2) {
+ return initials;
+ }
+ // If there are more than 2 initials, we will pick the first and last initial.
+ // Displaying > 2 letters in a circle doesn't look good.
+ return (initials[0] + initials[initials.length - 1]).toUpperCase();
});
const backgroundColor = computed(() => {