Skip to content

Commit 0f81bdc

Browse files
Merge pull request #3477 from ita-social-projects/hotfix/addresses
[Hotfix] fix addresses due to Google updates
2 parents 8cf331a + 7825160 commit 0f81bdc

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/app/main/component/shared/components/input-google-autocomplete/input-google-autocomplete.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ describe('InputGoogleAutocompleteComponent', () => {
3636
getPlacePredictions(request, callback) {
3737
return Promise.resolve(callback(predictionList, 'OK'));
3838
}
39-
}
39+
},
40+
AutocompleteSessionToken: class {}
4041
},
4142
Geocoder: class {
4243
geocode(params) {

src/app/main/component/shared/components/input-google-autocomplete/input-google-autocomplete.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,16 @@ export class InputGoogleAutocompleteComponent implements OnInit, OnDestroy, Cont
107107
}
108108

109109
initPredictList(): void {
110+
const sessionToken = new google.maps.places.AutocompleteSessionToken();
111+
110112
this.inputValue.valueChanges.pipe(takeUntil(this.destroy$), debounceTime(400)).subscribe((input: string) => {
111113
if (input) {
112114
const regex = new RegExp(Patterns.countriesRestriction);
113115
const request = {
114116
...this.autoCompRequest,
115117
input: `${this.requestPrefix ?? ''}${input}${this.requestSuffix ?? ''}`,
116-
language: this.languageService.getLangValue('uk', 'en')
118+
language: this.languageService.getLangValue('uk', 'en'),
119+
sessionToken
117120
};
118121

119122
this.autocompleteService.getPlacePredictions(request, (predictions: google.maps.places.AutocompletePrediction[]) => {

src/app/main/component/user/components/profile/edit-profile/edit-profile.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ describe('EditProfileComponent', () => {
4343
];
4444
callback(predictions, 'OK');
4545
}
46-
}
46+
},
47+
AutocompleteSessionToken: class {}
4748
}
4849
}
4950
};

src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const environment = {
22
production: false,
33
apiKeys: 'AIzaSyDanBliCzAuCZrsq67FeKEs3vqAilUD_is',
4-
apiMapKey: 'AIzaSyCU0ArzZlZ3n0pLq4o9MJy29LPT5DBMk4Y',
4+
apiMapKey: 'AIzaSyDaqjlemyxH1pLvF1EWfBDW2IPlgwJYXnU',
55
backendLink: 'https://greencity.greencity.cx.ua/',
66
backendChatLink: 'https://greencity-chat.greencity.cx.ua/',
77
backendUserLink: 'https://greencity-user.greencity.cx.ua/',

0 commit comments

Comments
 (0)