mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-30 22:05:19 +00:00
corrected a nasty bug, resolves #18
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -98,7 +98,7 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.menu_add_password:
|
case R.id.menu_add_password:
|
||||||
if (PasswordRepository.isInitialized()) {
|
if (!PasswordRepository.isInitialized()) {
|
||||||
initBefore.show();
|
initBefore.show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
// break;
|
// break;
|
||||||
|
|
||||||
case R.id.git_push:
|
case R.id.git_push:
|
||||||
if (PasswordRepository.isInitialized()) {
|
if (!PasswordRepository.isInitialized()) {
|
||||||
initBefore.show();
|
initBefore.show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case R.id.git_pull:
|
case R.id.git_pull:
|
||||||
if (PasswordRepository.isInitialized()) {
|
if (!PasswordRepository.isInitialized()) {
|
||||||
initBefore.show();
|
initBefore.show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -250,12 +250,14 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
|
|||||||
case 0:
|
case 0:
|
||||||
if(!localDir.equals(PasswordRepository.getWorkTree()))
|
if(!localDir.equals(PasswordRepository.getWorkTree()))
|
||||||
break;
|
break;
|
||||||
|
PasswordRepository.setInitialized(false);
|
||||||
|
|
||||||
ToCloneOrNot cloneFrag = new ToCloneOrNot();
|
ToCloneOrNot cloneFrag = new ToCloneOrNot();
|
||||||
fragmentTransaction.replace(R.id.main_layout, cloneFrag, "ToCloneOrNot");
|
fragmentTransaction.replace(R.id.main_layout, cloneFrag, "ToCloneOrNot");
|
||||||
fragmentTransaction.commit();
|
fragmentTransaction.commit();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
PasswordRepository.setInitialized(true);
|
||||||
PasswordFragment passFrag = new PasswordFragment();
|
PasswordFragment passFrag = new PasswordFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString("Path", localDir.getAbsolutePath());
|
args.putString("Path", localDir.getAbsolutePath());
|
||||||
|
@@ -38,7 +38,6 @@ public class PasswordRepository {
|
|||||||
.readEnvironment()
|
.readEnvironment()
|
||||||
.findGitDir()
|
.findGitDir()
|
||||||
.build();
|
.build();
|
||||||
initialized = true;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
@@ -51,6 +50,10 @@ public class PasswordRepository {
|
|||||||
return initialized;
|
return initialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setInitialized(boolean v) {
|
||||||
|
initialized = v;
|
||||||
|
}
|
||||||
|
|
||||||
public static void createRepository(File localDir) {
|
public static void createRepository(File localDir) {
|
||||||
localDir.delete();
|
localDir.delete();
|
||||||
|
|
||||||
@@ -71,6 +74,7 @@ public class PasswordRepository {
|
|||||||
.setName("master")
|
.setName("master")
|
||||||
.call();
|
.call();
|
||||||
|
|
||||||
|
initialized = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user