fix: fix type error when generating profile picture initials (#2742)
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
@@ -335,7 +335,8 @@
|
|||||||
"roles_description": "Roles are used to control access to the shared collections.",
|
"roles_description": "Roles are used to control access to the shared collections.",
|
||||||
"updated": "Profile updated",
|
"updated": "Profile updated",
|
||||||
"viewer": "Viewer",
|
"viewer": "Viewer",
|
||||||
"viewer_description": "Viewers can only view and use requests."
|
"viewer_description": "Viewers can only view and use requests.",
|
||||||
|
"default_hopp_displayname": "Hoppscotch User"
|
||||||
},
|
},
|
||||||
"remove": {
|
"remove": {
|
||||||
"star": "Remove star"
|
"star": "Remove star"
|
||||||
|
|||||||
@@ -71,8 +71,14 @@
|
|||||||
theme: 'tooltip',
|
theme: 'tooltip',
|
||||||
}"
|
}"
|
||||||
:url="currentUser.photoURL"
|
:url="currentUser.photoURL"
|
||||||
:alt="currentUser.displayName"
|
:alt="
|
||||||
:title="currentUser.displayName"
|
currentUser.displayName ||
|
||||||
|
t('profile.default_hopp_displayname')
|
||||||
|
"
|
||||||
|
:title="
|
||||||
|
currentUser.displayName ||
|
||||||
|
t('profile.default_hopp_displayname')
|
||||||
|
"
|
||||||
indicator
|
indicator
|
||||||
:indicator-styles="
|
:indicator-styles="
|
||||||
network.isOnline ? 'bg-green-500' : 'bg-red-500'
|
network.isOnline ? 'bg-green-500' : 'bg-red-500'
|
||||||
@@ -81,7 +87,10 @@
|
|||||||
<ProfilePicture
|
<ProfilePicture
|
||||||
v-else
|
v-else
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:title="currentUser.displayName"
|
:title="
|
||||||
|
currentUser.displayName ||
|
||||||
|
t('profile.default_hopp_displayname')
|
||||||
|
"
|
||||||
:initial="currentUser.displayName"
|
:initial="currentUser.displayName"
|
||||||
indicator
|
indicator
|
||||||
:indicator-styles="
|
:indicator-styles="
|
||||||
|
|||||||
@@ -16,9 +16,13 @@
|
|||||||
v-else
|
v-else
|
||||||
class="absolute flex items-center justify-center object-cover object-center transition bg-primaryDark text-accentContrast"
|
class="absolute flex items-center justify-center object-cover object-center transition bg-primaryDark text-accentContrast"
|
||||||
:class="[`rounded-${rounded}`, `w-${size} h-${size}`]"
|
:class="[`rounded-${rounded}`, `w-${size} h-${size}`]"
|
||||||
:style="`background-color: ${toHex(initial)}`"
|
:style="`background-color: ${initial ? toHex(initial) : '#480000'}`"
|
||||||
>
|
>
|
||||||
{{ initial.charAt(0).toUpperCase() }}
|
<template v-if="initial && initial.charAt(0).toUpperCase()">
|
||||||
|
{{ initial.charAt(0).toUpperCase() }}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<icon-lucide-user v-else></icon-lucide-user>
|
||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
v-if="indicator"
|
v-if="indicator"
|
||||||
@@ -30,7 +34,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from "vue"
|
import { defineComponent, PropType } from "vue"
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
@@ -59,7 +63,7 @@ export default defineComponent({
|
|||||||
default: "5",
|
default: "5",
|
||||||
},
|
},
|
||||||
initial: {
|
initial: {
|
||||||
type: String,
|
type: String as PropType<string | undefined | null>,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -37,7 +37,9 @@
|
|||||||
<ProfilePicture
|
<ProfilePicture
|
||||||
v-if="currentUser.photoURL"
|
v-if="currentUser.photoURL"
|
||||||
:url="currentUser.photoURL"
|
:url="currentUser.photoURL"
|
||||||
:alt="currentUser.displayName"
|
:alt="
|
||||||
|
currentUser.displayName || t('profile.default_displayname')
|
||||||
|
"
|
||||||
class="ring-primary ring-4"
|
class="ring-primary ring-4"
|
||||||
size="16"
|
size="16"
|
||||||
rounded="lg"
|
rounded="lg"
|
||||||
|
|||||||
Reference in New Issue
Block a user