1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-26 11:56:48 +01:00

Fossil Hybrid: dont write buttons unauthenticated

This commit is contained in:
Daniel Dakhno 2021-01-28 11:33:47 +01:00
parent 0c6ce453b2
commit 3a4c5f6483

View File

@ -186,9 +186,9 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
setVibrationStrength(); setVibrationStrength();
syncSettings(); syncSettings();
setTime(); setTime();
overwriteButtons(null);
} }
overwriteButtons(null);
loadBackground(); loadBackground();
loadWidgets(); loadWidgets();
@ -1081,6 +1081,10 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
@Override @Override
public void overwriteButtons(String jsonConfigString) { public void overwriteButtons(String jsonConfigString) {
if (connectionMode == CONNECTION_MODE.NOT_AUTHENTICATED) {
GB.toast("not available in unauthenticated mode", Toast.LENGTH_LONG, GB.ERROR);
return;
}
try { try {
JSONArray jsonArray = new JSONArray( JSONArray jsonArray = new JSONArray(
GBApplication.getPrefs().getString(HRConfigActivity.CONFIG_KEY_Q_ACTIONS, "[]") GBApplication.getPrefs().getString(HRConfigActivity.CONFIG_KEY_Q_ACTIONS, "[]")