Skip to content

Commit

Permalink
Fix "Share to Syncthing" when user didn't complete welcome wizard (fixes
Browse files Browse the repository at this point in the history
 #354) (#360)

* Add string: complete_welcome_wizard_first

* Imported de translation

* Fix "Share to Syncthing" when user didn't complete welcome wizard (fixes #354)
  • Loading branch information
Catfriend1 authored Mar 9, 2019
1 parent 20e6a42 commit c8502cc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.nutomic.syncthingandroid.service.SyncthingService;
import com.nutomic.syncthingandroid.service.SyncthingServiceBinder;
import com.nutomic.syncthingandroid.util.ConfigRouter;
import com.nutomic.syncthingandroid.util.ConfigXml.OpenConfigException;
import com.nutomic.syncthingandroid.util.Util;

import java.io.File;
Expand Down Expand Up @@ -76,7 +77,14 @@ public void onServiceConnected(ComponentName componentName, IBinder iBinder) {

@Override
public void onServiceStateChange(SyncthingService.State currentState) {
List<Folder> folders = mConfig.getFolders(getApi());
List<Folder> folders = null;
try {
folders = mConfig.getFolders(getApi());
} catch (OpenConfigException e) {
Toast.makeText(this, getString(R.string.complete_welcome_wizard_first), Toast.LENGTH_LONG).show();
finish();
return;
}

// Get the index of the previously selected folder.
int folderIndex = 0;
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,9 @@ Bitte melden Sie auftretende Probleme via GitHub.</string>
<!-- ShareActivity -->


<!-- Toast if user didn't complete the welcome wizard yet -->
<string name="complete_welcome_wizard_first">Starte zuerst die App aus der App-Übersicht und schließe den Willkommensassistenten ab, bevor Du Dateien teilst.</string>

<!-- Title of the "share" activity -->
<string name="share_activity_title">Speichern in Syncthing</string>

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,9 @@ Please report any problems you encounter via Github.</string>
<!-- ShareActivity -->


<!-- Toast if user didn't complete the welcome wizard yet -->
<string name="complete_welcome_wizard_first">First, launch the app from the app drawer and complete the welcome wizard before sharing files.</string>

<!-- Title of the "share" activity -->
<string name="share_activity_title">Save to Syncthing</string>

Expand Down

0 comments on commit c8502cc

Please sign in to comment.