File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ const initialState = {
110
110
let name = c . info ?. name
111
111
112
112
if (
113
- ! name &&
113
+ ! name ?. trim ( ) &&
114
114
! user &&
115
115
! out ?. xkeyId &&
116
116
out ?. address
Original file line number Diff line number Diff line change @@ -489,7 +489,8 @@ export async function restate(
489
489
}
490
490
491
491
export function filterPairedContacts ( contact ) {
492
- return ! ! contact . alias || ! ! contact . info ?. name ?. trim ( )
492
+ let outLen = Object . keys ( contact . outgoing || { } ) . length
493
+ return outLen > 0 // && !!contact.alias
493
494
}
494
495
495
496
export function filterUnpairedContacts ( contact ) {
Original file line number Diff line number Diff line change @@ -147,13 +147,21 @@ export let editContactRig = (async function (globals) {
147
147
</ button >
148
148
</ footer >
149
149
` ,
150
+ getAlias : state => {
151
+ let alias = state . contact ?. alias || state . contact ?. info ?. preferred_username
152
+ if ( ! alias ) {
153
+ return ''
154
+ }
155
+
156
+ return html `@${ alias } `
157
+ } ,
150
158
content : async state => html `
151
159
< fieldset class ="contact ">
152
160
< section >
153
161
${ state . header ( state ) }
154
162
< article >
155
163
${ await getAvatar ( state . contact ) }
156
- < h3 > @ ${ state . contact ?. alias || state . contact ?. info ?. preferred_username } </ h3 >
164
+ < h3 > ${ state . getAlias ( state ) } </ h3 >
157
165
</ article >
158
166
< article >
159
167
< label for ="contactName ">
@@ -185,7 +193,7 @@ export let editContactRig = (async function (globals) {
185
193
pattern ="${ ALIAS_REGEX . source } "
186
194
spellcheck ="false "
187
195
autocomplete ="off "
188
- value ="${ state . contact ?. alias } "
196
+ value ="${ state . contact ?. alias || '' } "
189
197
/>
190
198
</ div >
191
199
< p > Alias for the contact (similar to a @username)</ p >
You can’t perform that action at this time.
0 commit comments