forked from cory/tildefriends
		
	Show names in the id picker.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4623 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		| @@ -1,5 +1,5 @@ | |||||||
| { | { | ||||||
|   "type": "tildefriends-app", |   "type": "tildefriends-app", | ||||||
|   "emoji": "🐌", |   "emoji": "🐌", | ||||||
|   "previous": "&eHrt88ylDUCaDFIj3DTdUaHPYQRe81K//O80CHp+pyk=.sha256" |   "previous": "&dc3Eovh35uB024L4dyFX+n8N37ove9STsKmkKlO/pcQ=.sha256" | ||||||
| } | } | ||||||
| @@ -183,7 +183,7 @@ class TfElement extends LitElement { | |||||||
|  |  | ||||||
| 	render_id_picker() { | 	render_id_picker() { | ||||||
| 		return html` | 		return html` | ||||||
| 			<tf-id-picker id="picker" selected=${this.whoami} .ids=${this.ids} @change=${this._handle_whoami_changed}></tf-id-picker> | 			<tf-id-picker id="picker" selected=${this.whoami} .ids=${this.ids} .users=${this.users} @change=${this._handle_whoami_changed}></tf-id-picker> | ||||||
| 			<button @click=${this.create_identity} id="create_identity">Create Identity</button> | 			<button @click=${this.create_identity} id="create_identity">Create Identity</button> | ||||||
| 		`; | 		`; | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -9,12 +9,14 @@ class TfIdentityPickerElement extends LitElement { | |||||||
| 		return { | 		return { | ||||||
| 			ids: {type: Array}, | 			ids: {type: Array}, | ||||||
| 			selected: {type: String}, | 			selected: {type: String}, | ||||||
|  | 			users: {type: Object}, | ||||||
| 		}; | 		}; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	constructor() { | 	constructor() { | ||||||
| 		super(); | 		super(); | ||||||
| 		this.ids = []; | 		this.ids = []; | ||||||
|  | 		this.users = {}; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	changed(event) { | 	changed(event) { | ||||||
| @@ -27,7 +29,7 @@ class TfIdentityPickerElement extends LitElement { | |||||||
| 	render() { | 	render() { | ||||||
| 		return html` | 		return html` | ||||||
| 			<select @change=${this.changed} style="max-width: 100%"> | 			<select @change=${this.changed} style="max-width: 100%"> | ||||||
| 				${(this.ids ?? []).map(id => html`<option ?selected=${id == this.selected} value=${id}>${id}</option>`)} | 				${(this.ids ?? []).map(id => html`<option ?selected=${id == this.selected} value=${id}>${this.users[id]?.name ? (this.users[id]?.name + ' - ') : undefined}<small>${id}</small></option>`)} | ||||||
| 			</select> | 			</select> | ||||||
| 		`; | 		`; | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user