Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hotfix] fix addresses due to Google updates #3477

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ describe('InputGoogleAutocompleteComponent', () => {
getPlacePredictions(request, callback) {
return Promise.resolve(callback(predictionList, 'OK'));
}
}
},
AutocompleteSessionToken: class {}
},
Geocoder: class {
geocode(params) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,16 @@ export class InputGoogleAutocompleteComponent implements OnInit, OnDestroy, Cont
}

initPredictList(): void {
const sessionToken = new google.maps.places.AutocompleteSessionToken();

this.inputValue.valueChanges.pipe(takeUntil(this.destroy$), debounceTime(400)).subscribe((input: string) => {
if (input) {
const regex = new RegExp(Patterns.countriesRestriction);
const request = {
...this.autoCompRequest,
input: `${this.requestPrefix ?? ''}${input}${this.requestSuffix ?? ''}`,
language: this.languageService.getLangValue('uk', 'en')
language: this.languageService.getLangValue('uk', 'en'),
sessionToken
};

this.autocompleteService.getPlacePredictions(request, (predictions: google.maps.places.AutocompletePrediction[]) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ describe('EditProfileComponent', () => {
];
callback(predictions, 'OK');
}
}
},
AutocompleteSessionToken: class {}
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const environment = {
production: false,
apiKeys: 'AIzaSyDanBliCzAuCZrsq67FeKEs3vqAilUD_is',
apiMapKey: 'AIzaSyCU0ArzZlZ3n0pLq4o9MJy29LPT5DBMk4Y',
apiMapKey: 'AIzaSyDaqjlemyxH1pLvF1EWfBDW2IPlgwJYXnU',
backendLink: 'https://greencity.greencity.cx.ua/',
backendChatLink: 'https://greencity-chat.greencity.cx.ua/',
backendUserLink: 'https://greencity-user.greencity.cx.ua/',
Expand Down
Loading