mirror of
https://github.com/PaiGramTeam/luoxu-api-pub.git
synced 2024-11-22 07:08:05 +00:00
keep selected sender from hash until user selects others
This commit is contained in:
parent
acf925e616
commit
5e7e55b485
@ -15,6 +15,7 @@
|
||||
let loading = false
|
||||
let need_update_title = false
|
||||
let sender
|
||||
let selected_init
|
||||
|
||||
setContext('LUOXU_URL', LUOXU_URL)
|
||||
|
||||
@ -79,6 +80,7 @@
|
||||
}
|
||||
if(info.has('sender')) {
|
||||
sender = info.get('sender')
|
||||
selected_init = sender
|
||||
}
|
||||
if((group || islocal) && query) {
|
||||
result = null
|
||||
@ -176,7 +178,7 @@
|
||||
on:input={() => error = ''}
|
||||
on:keydown={e => {if(e.key == 'Enter'){do_search()}}}
|
||||
/>
|
||||
<Name group={group} bind:selected={sender}/>
|
||||
<Name group={group} bind:selected={sender} selected_init={selected_init}/>
|
||||
<button on:click={() => do_search()}>搜索</button>
|
||||
</div>
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
export let group
|
||||
|
||||
export let selected
|
||||
export let selected_init
|
||||
let selected_name = ''
|
||||
let selected_idx
|
||||
|
||||
@ -76,16 +77,17 @@
|
||||
selected = names[selected_idx][0]
|
||||
selected_name = names[selected_idx][1]
|
||||
input.value = selected_name
|
||||
selected_init = null
|
||||
}
|
||||
|
||||
function update_value() {
|
||||
if(!selected) {
|
||||
if(!selected || selected === selected_init) {
|
||||
return
|
||||
}
|
||||
if(input.value) {
|
||||
input.value = selected_name
|
||||
}else{
|
||||
selected = null
|
||||
selected = selected_init
|
||||
selected_name = ''
|
||||
}
|
||||
}
|
||||
@ -118,7 +120,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: NOT operator
|
||||
|
||||
</script>
|
||||
|
||||
<div>
|
||||
|
Loading…
Reference in New Issue
Block a user