Game Log immediately show profile

Bit of a crude fix...
This commit is contained in:
Natsumi
2020-12-02 21:00:15 +13:00
committed by pypy
parent 8aa1b2621f
commit 26f2d29bba

View File

@@ -4640,7 +4640,7 @@ import gameLogService from './service/gamelog.js'
Discord.SetActive(this.discordActive); Discord.SetActive(this.discordActive);
}; };
$app.methods.lookupUser = function (name) { $app.methods.lookupUser = async function (name) {
for (var ref of API.cachedUsers.values()) { for (var ref of API.cachedUsers.values()) {
if (ref.displayName === name) { if (ref.displayName === name) {
this.showUserDialog(ref.id); this.showUserDialog(ref.id);
@@ -4648,9 +4648,15 @@ import gameLogService from './service/gamelog.js'
} }
} }
this.searchText = name; this.searchText = name;
this.search();
this.$refs.menu.activeIndex = 'search';
this.$refs.searchTab.currentName = '0'; this.$refs.searchTab.currentName = '0';
await this.search();
for (var ref of API.cachedUsers.values()) {
if (ref.displayName === name) {
this.showUserDialog(ref.id);
return;
}
}
this.$refs.menu.activeIndex = 'search';
}; };
// App: Search // App: Search
@@ -4687,21 +4693,21 @@ import gameLogService from './service/gamelog.js'
this.searchAvatarResults = []; this.searchAvatarResults = [];
}; };
$app.methods.search = function () { $app.methods.search = async function () {
this.searchUser(); await this.searchUser();
this.searchWorld({}); this.searchWorld({});
}; };
$app.methods.searchUser = function () { $app.methods.searchUser = async function () {
this.searchUserParams = { this.searchUserParams = {
n: 10, n: 10,
offset: 0, offset: 0,
search: this.searchText search: this.searchText
}; };
this.moreSearchUser(); await this.moreSearchUser();
}; };
$app.methods.moreSearchUser = function (go) { $app.methods.moreSearchUser = async function (go) {
var params = this.searchUserParams; var params = this.searchUserParams;
if (go) { if (go) {
params.offset += params.n * go; params.offset += params.n * go;
@@ -4710,7 +4716,7 @@ import gameLogService from './service/gamelog.js'
} }
} }
this.isSearchUserLoading = true; this.isSearchUserLoading = true;
API.getUsers(params).finally(() => { await API.getUsers(params).finally(() => {
this.isSearchUserLoading = false; this.isSearchUserLoading = false;
}).then((args) => { }).then((args) => {
var map = new Map(); var map = new Map();