File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 mdiAlert ,
99 mdiAccount ,
1010} from ' @mdi/js'
11- import { formatPhoneNumber } from ' ~/utils/filters'
12- import { isValidPhoneNumber } from ' libphonenumber-js'
11+ import { formatPhoneNumber , startsWithLetter } from ' ~/utils/filters'
1312
1413const { mdAndDown } = useDisplay ()
1514const threadsStore = useThreadsStore ()
@@ -109,7 +108,7 @@ function onInstallApp() {
109108 >
110109 <template #prepend >
111110 <v-avatar :color =" thread.color" size =" 40" >
112- <v-icon v-if =" isValidPhoneNumber (thread.contact)" color =" white" >{{
111+ <v-icon v-if =" !startsWithLetter (thread.contact)" color =" white" >{{
113112 mdiAccount
114113 }}</v-icon >
115114 <span v-else class =" text-white text-headline-small" >{{
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import Pusher from 'pusher-js'
1919import type { Channel } from ' pusher-js'
2020import { isValidPhoneNumber } from ' libphonenumber-js'
2121import type { EntitiesMessage } from ' ~~/shared/types/api'
22+ import { startsWithLetter } from ' ~/utils/filters'
2223
2324definePageMeta ({
2425 middleware: [' auth' ],
@@ -337,7 +338,7 @@ onBeforeUnmount(() => {
337338 size =" 40"
338339 >
339340 <v-icon
340- v-if =" isValidPhoneNumber (message.contact)"
341+ v-if =" !startsWithLetter (message.contact)"
341342 color =" white"
342343 >{{ mdiAccount }}</v-icon
343344 >
Original file line number Diff line number Diff line change @@ -99,3 +99,7 @@ export function humanizeTime(value: string): string {
9999 } )
100100 return formatDuration ( durations )
101101}
102+
103+ export function startsWithLetter ( value : string ) : boolean {
104+ return / ^ [ a - z A - Z ] / . test ( value )
105+ }
You can’t perform that action at this time.
0 commit comments