Skip to content

Commit

Permalink
fix(airplane-mode): app can't launch
Browse files Browse the repository at this point in the history
  • Loading branch information
azarz committed Feb 10, 2025
1 parent d4f6946 commit 8615eb0
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 6 deletions.
2 changes: 1 addition & 1 deletion android/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions android/.idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions android/.idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion android/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions android/.idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.1'
classpath 'com.android.tools.build:gradle:8.8.0'
// classpath 'com.google.gms:google-services:4.4.0'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 2 additions & 1 deletion src/js/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* This program and the accompanying materials are made available under the terms of the GPL License, Version 3.0.
*/
import { Network } from "@capacitor/network";

/** global: map */
let map = null;
Expand Down Expand Up @@ -98,7 +99,7 @@ let landmark = null;
let compareLandmark = null;

// Global flag: is the device connected to the internet?
let online = true;
let online = (await Network.getStatus()).connected;

// Scroll
let maxScroll = (document.scrollingElement.scrollHeight - document.scrollingElement.clientHeight);
Expand Down
5 changes: 4 additions & 1 deletion src/js/layer-manager/layer-switcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ class LayerSwitcher extends EventTarget {
if (typeof id !== "undefined") {
if (this.layers[id].type === "vector") {
var pos = this.layers[id].position;
var beforeId = this.map.getStyle().layers[this.#getIndexLayer(pos)].id;
var beforeId = 0;
if (this.map.getStyle().layers.length) {
beforeId = this.map.getStyle().layers[this.#getIndexLayer(pos)].id;
}
var max = (pos === Object.keys(this.layers).length - 1);
if (!max) {
// ne jamais déplacer le groupe avant le background tout blanc
Expand Down
3 changes: 3 additions & 0 deletions src/js/poi.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class POI {
async load() {
var props = LayersConfig.getLayerProps(this.id);
var style = props.style; // url !
if (!Globals.online) {
style = props.fallbackStyle; // url !;
}

return fetch(style)
.then((response) => {
Expand Down

0 comments on commit 8615eb0

Please sign in to comment.