forked from trent_larson/crowd-funder-for-time-pwa
add Discover query param searchPeople to go straight to people map
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user