From 26f2d29bbacfd56feb6cd4e1add702fc9333eb04 Mon Sep 17 00:00:00 2001 From: Natsumi Date: Wed, 2 Dec 2020 21:00:15 +1300 Subject: [PATCH] Game Log immediately show profile Bit of a crude fix... --- html/src/app.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/html/src/app.js b/html/src/app.js index a7eaf840..fe35c9e6 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -4640,7 +4640,7 @@ import gameLogService from './service/gamelog.js' Discord.SetActive(this.discordActive); }; - $app.methods.lookupUser = function (name) { + $app.methods.lookupUser = async function (name) { for (var ref of API.cachedUsers.values()) { if (ref.displayName === name) { this.showUserDialog(ref.id); @@ -4648,9 +4648,15 @@ import gameLogService from './service/gamelog.js' } } this.searchText = name; - this.search(); - this.$refs.menu.activeIndex = 'search'; 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 @@ -4687,21 +4693,21 @@ import gameLogService from './service/gamelog.js' this.searchAvatarResults = []; }; - $app.methods.search = function () { - this.searchUser(); + $app.methods.search = async function () { + await this.searchUser(); this.searchWorld({}); }; - $app.methods.searchUser = function () { + $app.methods.searchUser = async function () { this.searchUserParams = { n: 10, offset: 0, search: this.searchText }; - this.moreSearchUser(); + await this.moreSearchUser(); }; - $app.methods.moreSearchUser = function (go) { + $app.methods.moreSearchUser = async function (go) { var params = this.searchUserParams; if (go) { params.offset += params.n * go; @@ -4710,7 +4716,7 @@ import gameLogService from './service/gamelog.js' } } this.isSearchUserLoading = true; - API.getUsers(params).finally(() => { + await API.getUsers(params).finally(() => { this.isSearchUserLoading = false; }).then((args) => { var map = new Map();