diff --git a/src/App.svelte b/src/App.svelte index 5a98617..a313604 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -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()}}} /> - + diff --git a/src/Name.svelte b/src/Name.svelte index 68c3a1d..050c61c 100644 --- a/src/Name.svelte +++ b/src/Name.svelte @@ -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 +