mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-25 22:01:16 +00:00
Update Syncthing URL on restart if it was changed (fixes #442).
This commit is contained in:
parent
6a686cdb95
commit
f4c15a98e6
2 changed files with 8 additions and 2 deletions
|
@ -150,7 +150,7 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
|||
|
||||
private String mVersion;
|
||||
|
||||
private final String mUrl;
|
||||
private String mUrl;
|
||||
|
||||
private final String mApiKey;
|
||||
|
||||
|
@ -200,6 +200,10 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
|||
mOnConfigChangedListener = configListener;
|
||||
}
|
||||
|
||||
public void setWebGuiUrl(String newUrl) {
|
||||
mUrl = newUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Number of previous calls to {@link #tryIsAvailable()}.
|
||||
*/
|
||||
|
|
|
@ -227,8 +227,10 @@ public class SyncthingService extends Service implements
|
|||
if (mConfig != null) {
|
||||
mCurrentState = State.STARTING;
|
||||
|
||||
if (mApi != null)
|
||||
if (mApi != null) {
|
||||
registerOnWebGuiAvailableListener(mApi);
|
||||
mApi.setWebGuiUrl(mConfig.getWebGuiUrl());
|
||||
}
|
||||
if (mEventProcessor != null)
|
||||
registerOnWebGuiAvailableListener(mEventProcessor);
|
||||
new PollWebGuiAvailableTaskImpl(getFilesDir() + "/" + HTTPS_CERT_FILE)
|
||||
|
|
Loading…
Reference in a new issue