MCPcopy
hub / github.com/electerm/electerm / genId

Function genId

src/client/components/profile/profile-form-elem.jsx:24–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22 const [activeTab, setActiveTab] = useState('ssh')
23 const { profiles } = props.store
24 function genId () {
25 let count = profiles.length ? profiles.length : ''
26 let id = 'PROFILE' + count
27 while (profiles.find(d => d.id === id)) {
28 count = count + 1
29 id = 'PROFILE' + count
30 }
31 return id
32 }
33 const handleSubmit = action(async function (res) {
34 const { formData } = props
35 const update1 = {

Callers 1

ProfileFormElemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected