Skip to content

Commit bccf459

Browse files
authored
Merge pull request #39 from BuildFire/fix/deeplink-data
fix(widget): reading location id - PLUG-1871
2 parents a422a3e + 83f0e72 commit bccf459

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/control/content/js/locations/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,6 +1908,7 @@ const triggerWidgetOnLocationsUpdate = ({ realtimeUpdate = false, isCancel = fal
19081908
let data = null;
19091909
if (realtimeUpdate) {
19101910
data = {
1911+
...state.locationObj,
19111912
id: state.locationObj.id,
19121913
title: addLocationControls.locationTitle.value,
19131914
subtitle: addLocationControls.locationSubtitle.value,

src/widget/js/util/helpers.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ export const shareLocation = () => {
149149
};
150150

151151
export const bookmarkLocation = (locationId, e) => {
152-
const location = state.listLocations.find((i) => i.id === locationId);
152+
let location = state.listLocations.find((i) => i.id === locationId);
153+
if (!location) {
154+
location = state.selectedLocation.id === locationId ? state.selectedLocation : null;
155+
}
153156
const { bookmarks } = state.settings;
154157

155158
if (state.bookmarkLoading || !location || !bookmarks.enabled || !bookmarks.allowForLocations) return;

src/widget/widget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,7 @@ const navigateToLocationId = (locationId) => {
16321632
refreshCategories()
16331633
.then(() => WidgetController.getLocation(locationId))
16341634
.then((response) => {
1635-
state.selectedLocation = response.data;
1635+
state.selectedLocation = { ...response.data, id: response.id };
16361636
showLocationDetail();
16371637
})
16381638
.catch((err) => {

0 commit comments

Comments
 (0)