add Discover query param searchPeople to go straight to people map

This commit is contained in:
2025-02-17 19:19:38 -07:00
parent 1bdb3cc3e2
commit 5d5a8a4509
5 changed files with 50 additions and 38 deletions

View File

@@ -352,9 +352,9 @@ export default class DiscoverView extends Vue {
allMyDids: Array<string> = [];
apiServer = "";
isLoading = false;
isLocalActive = true;
isLocalActive = false;
isMappedActive = false;
isAnywhereActive = false;
isAnywhereActive = true;
isProjectsActive = true;
isPeopleActive = false;
isSearchVisible = true;
@@ -375,6 +375,11 @@ export default class DiscoverView extends Vue {
didInfo = didInfo;
async mounted() {
this.searchTerms = this.$route.query["searchText"]?.toString() || "";
const searchPeople = !!this.$route.query["searchPeople"];
const settings = await retrieveSettingsForActiveAccount();
this.activeDid = (settings.activeDid as string) || "";
this.apiServer = (settings.apiServer as string) || "";
@@ -386,26 +391,30 @@ export default class DiscoverView extends Vue {
this.allMyDids = await retrieveAccountDids();
this.searchTerms = this.$route.query["searchText"]?.toString() || "";
if (!settings.finishedOnboarding) {
(this.$refs.onboardingDialog as OnboardingDialog).open(
OnboardPage.Discover,
);
}
if (this.searchBox) {
await this.searchLocal();
// Someday we'll have enough people that we can default to their local area.
// if (this.searchBox) {
// this.isLocalActive = true;
// this.isAnywhereActive = false;
// await this.searchLocal();
//
// const bbox = this.searchBox.bbox;
// this.localCenterLat = (bbox.maxLat + bbox.minLat) / 2;
// this.localCenterLong = (bbox.eastLong + bbox.westLong) / 2;
// } else {
const bbox = this.searchBox.bbox;
this.localCenterLat = (bbox.maxLat + bbox.minLat) / 2;
this.localCenterLong = (bbox.eastLong + bbox.westLong) / 2;
} else {
this.isLocalActive = false;
this.isMappedActive = false;
this.isAnywhereActive = true;
await this.searchAll();
if (searchPeople) {
this.isPeopleActive = true;
this.isProjectsActive = false;
this.isMappedActive = true;
this.isAnywhereActive = false;
}
await this.searchAll();
}
public resetCounts() {