Quick search history

This commit is contained in:
Natsumi
2021-11-20 00:18:51 +13:00
parent f2541f9232
commit 9c4e8e5ba9

View File

@@ -6969,9 +6969,30 @@ speechSynthesis.getVoices();
if (value) {
this.quickSearch = '';
this.quickSearchItems = [];
this.quickSearchUserHistory();
}
};
// App: Quick Search User History
$app.data.showUserDialogHistory = new Set();
$app.methods.quickSearchUserHistory = function () {
var userHistory = Array.from(this.showUserDialogHistory.values()).reverse().slice(0, 5);
var results = [];
userHistory.forEach((userId) => {
var ref = API.cachedUsers.get(userId);
if (typeof ref !== 'undefined') {
results.push({
value: ref.id,
label: ref.name,
ref
});
}
});
this.quickSearchItems = results;
};
// App: Feed
$app.methods.feedSearch = function (row) {
@@ -10876,6 +10897,8 @@ speechSynthesis.getVoices();
}
return args;
});
this.showUserDialogHistory.delete(userId);
this.showUserDialogHistory.add(userId);
};
$app.methods.applyUserDialogLocation = function () {