Skip to content

Commit 6b8ba66

Browse files
fix(device): Fix geolocationDesired / geolocationOptions values in manager
1 parent 7a92228 commit 6b8ba66

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/device.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,14 @@ export class DeviceService {
151151
return this.stage['meta'] ? this.stage['meta'].geoVerticalAccuracy : undefined;
152152
}
153153

154+
public _geolocationDesired = false;
154155
public get geolocationDesired() {
155-
return this._parentState && this._parentState.geolocationDesired || false;
156+
return this._parentState ? this._parentState.geolocationDesired : this._geolocationDesired;
156157
}
157158

159+
public _geolocationOptions:GeolocationOptions|undefined;
158160
public get geolocationOptions() {
159-
return this._parentState && this._parentState.geolocationOptions;
161+
return this._parentState ? this._parentState.geolocationOptions : this._geolocationOptions;
160162
}
161163

162164
public defaultUserHeight = AVERAGE_EYE_HEIGHT;
@@ -1045,8 +1047,8 @@ export class DeviceServiceProvider {
10451047
public publishStableState() {
10461048
const stableState = this._stableState;
10471049

1048-
stableState.geolocationDesired = this.contextServiceProvider.geolocationDesired;
1049-
stableState.geolocationOptions = stableState.geolocationOptions || {};
1050+
this.deviceService._geolocationDesired = stableState.geolocationDesired = this.contextServiceProvider.geolocationDesired;
1051+
this.deviceService._geolocationOptions = stableState.geolocationOptions = stableState.geolocationOptions || {};
10501052
stableState.geolocationOptions.enableHighAccuracy = this.contextServiceProvider.desiredGeolocationOptions.enableHighAccuracy;
10511053
stableState.suggestedUserHeight = this.deviceService.suggestedUserHeight;
10521054
stableState.strict = this.deviceService.strict;

0 commit comments

Comments
 (0)