Fix initing search by hashtag
This commit is contained in:
parent
6b90f05d68
commit
d479c08bbd
@ -132,9 +132,14 @@ export default class AppSearch {
|
||||
this.searchPromise = null;
|
||||
}
|
||||
|
||||
public beginSearch(peerId = 0, threadId = 0) {
|
||||
public beginSearch(peerId = 0, threadId = 0, query = '') {
|
||||
this.peerId = peerId;
|
||||
this.threadId = threadId;
|
||||
|
||||
if(this.query !== query) {
|
||||
this.searchInput.inputField.value = query;
|
||||
}
|
||||
|
||||
this.searchInput.input.focus();
|
||||
}
|
||||
|
||||
|
@ -19,10 +19,11 @@ export default class AppPrivateSearchTab extends SliderSuperTab {
|
||||
|
||||
private peerId = 0;
|
||||
private threadId = 0;
|
||||
private query = '';
|
||||
private onDatePick: (timestamp: number) => void;
|
||||
|
||||
onOpenAfterTimeout() {
|
||||
this.appSearch.beginSearch(this.peerId, this.threadId);
|
||||
this.appSearch.beginSearch(this.peerId, this.threadId, this.query);
|
||||
}
|
||||
|
||||
protected init() {
|
||||
@ -44,18 +45,9 @@ export default class AppPrivateSearchTab extends SliderSuperTab {
|
||||
|
||||
open(peerId: number, threadId?: number, onDatePick?: AppPrivateSearchTab['onDatePick'], query?: string) {
|
||||
const ret = super.open();
|
||||
if(this.init) {
|
||||
this.init();
|
||||
this.init = null;
|
||||
}
|
||||
|
||||
query && (this.inputSearch.inputField.value = query);
|
||||
|
||||
if(this.peerId !== 0) {
|
||||
this.appSearch.beginSearch(this.peerId, this.threadId);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if(!this.peerId) {
|
||||
this.query = query;
|
||||
this.peerId = peerId;
|
||||
this.threadId = threadId;
|
||||
this.onDatePick = onDatePick;
|
||||
@ -67,7 +59,13 @@ export default class AppPrivateSearchTab extends SliderSuperTab {
|
||||
});
|
||||
}
|
||||
|
||||
query && this.appSearch.searchInput.inputField.setValueSilently(query);
|
||||
|
||||
appSidebarRight.toggleSidebar(true);
|
||||
} else {
|
||||
this.appSearch.beginSearch(this.peerId, this.threadId, query);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user