1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-26 22:31:16 +00:00

Fixed deleting folders not working.

This commit is contained in:
Felix Ableitner 2014-10-12 16:00:57 +03:00
parent d993f1917f
commit 9940f5c437
2 changed files with 4 additions and 4 deletions

View file

@ -812,13 +812,13 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
*/
public boolean deleteFolder(Folder folder, Activity activity) {
try {
JSONArray folders = mConfig.getJSONArray("Folder");
JSONArray folders = mConfig.getJSONArray("Folders");
for (int i = 0; i < folders.length(); i++) {
JSONObject json = folders.getJSONObject(i);
if (folder.ID.equals(json.getString("ID"))) {
mConfig.remove("Folder");
mConfig.put("Folder", delete(folders, folders.getJSONObject(i)));
mConfig.remove("Folders");
mConfig.put("Folders", delete(folders, folders.getJSONObject(i)));
break;
}
}
@ -868,7 +868,6 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
String error = null;
try {
JSONObject json = new JSONObject(s);
Log.d(TAG, s);
normalized = json.optString("id", null);
error = json.optString("error", null);
} catch (JSONException e) {

View file

@ -353,6 +353,7 @@ public class SyncthingService extends Service {
}
Log.i(TAG, "Web GUI has come online at " + mConfig.getWebGuiUrl());
mCurrentState = State.ACTIVE;
onApiChange();
for (OnWebGuiAvailableListener listener : mOnWebGuiAvailableListeners) {
listener.onWebGuiAvailable();
}