connectcore-demo-example: use is_local_access for local run detection
According to the API, navigator.platform is unreliable and not recommended for runtime detection. As our platforms are ARM based, we were using it to get the platform and grep for a literal arm. That fails for example when using chromium browser on the ConnectCore devices, as it is reporting 'Linux x86_64' even running on an arm64 device. Instead use the already implemented is_local_access function to detect whether the browser is running locally in the target. https://onedigi.atlassian.net/browse/DEL-9838 Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
parent
79bd5559bf
commit
876b1d55fc
|
|
@ -531,7 +531,7 @@ function getDeviceName() {
|
||||||
// Updates the available web sections.
|
// Updates the available web sections.
|
||||||
function updateAvailableSections() {
|
function updateAvailableSections() {
|
||||||
// Remove device specific sections when rendering the demo from a computer.
|
// Remove device specific sections when rendering the demo from a computer.
|
||||||
if (!navigator.platform.includes("aarch") && !navigator.platform.includes("arm")) {
|
if (!is_local_access()) {
|
||||||
removeSection(ID_SECTION_MULTIMEDIA);
|
removeSection(ID_SECTION_MULTIMEDIA);
|
||||||
removeSection(ID_SECTION_NPU);
|
removeSection(ID_SECTION_NPU);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue