28
28
/>
29
29
</el-form-item >
30
30
<template v-for =" (identity , ii ) of model .identities " :key =" ` ${identity }${ii } ` " >
31
- <div v-if =" value.enabled && identity.platform === key" >
31
+ <div v-if =" value.enabled && identity.platform === key && identity.url " >
32
32
<div
33
33
class =" flex flex-grow gap-2 mt-1 pb-3 last:!mb-6 last:pb-0"
34
34
>
@@ -132,7 +132,7 @@ const identitiesForm = reactive({
132
132
github: {
133
133
label: ' GitHub' ,
134
134
enabled:
135
- props .modelValue .identities ? .some ((el ) => el .platform === ' github' )
135
+ props .modelValue .identities ? .some ((el ) => el .platform === ' github' && el . url )
136
136
|| false ,
137
137
urlPrefix: ' github.com/' ,
138
138
imgContainerClass:
@@ -141,7 +141,7 @@ const identitiesForm = reactive({
141
141
linkedin: {
142
142
label: ' LinkedIn' ,
143
143
enabled:
144
- props .modelValue .identities ? .some ((el ) => el .platform === ' linkedin' )
144
+ props .modelValue .identities ? .some ((el ) => el .platform === ' linkedin' && el . url )
145
145
|| false ,
146
146
urlPrefix: ' linkedin.com/company/' ,
147
147
imgContainerClass:
@@ -150,7 +150,7 @@ const identitiesForm = reactive({
150
150
twitter: {
151
151
label: ' Twitter' ,
152
152
enabled:
153
- props .modelValue .identities ? .some ((el ) => el .platform === ' twitter' )
153
+ props .modelValue .identities ? .some ((el ) => el .platform === ' twitter' && el . url )
154
154
|| false ,
155
155
urlPrefix: ' twitter.com/' ,
156
156
imgContainerClass:
@@ -159,7 +159,7 @@ const identitiesForm = reactive({
159
159
crunchbase: {
160
160
label: ' Crunchbase' ,
161
161
enabled:
162
- props .modelValue .identities ? .some ((el ) => el .platform === ' crunchbase' )
162
+ props .modelValue .identities ? .some ((el ) => el .platform === ' crunchbase' && el . url )
163
163
|| false ,
164
164
urlPrefix: ' crunchbase.com/organization/' ,
165
165
imgContainerClass:
@@ -172,15 +172,10 @@ function findPlatform(platform) {
172
172
}
173
173
174
174
function onInputChange (newValue , key , value , index ) {
175
- if (index === 0 ) {
176
- model .value .attributes = {
177
- ... props .modelValue .attributes ,
178
- url: {
179
- ... props .modelValue .attributes ? .url ,
180
- [key]: ` https://${ value .urlPrefix }${ newValue} ` ,
181
- },
182
- };
183
- }
175
+ model .value .identities [index] = {
176
+ ... props .modelValue .identities [index],
177
+ url: ` https://${ value .urlPrefix }${ newValue} ` ,
178
+ };
184
179
}
185
180
186
181
function platformInIdentities (platform ) {
0 commit comments