Skip to content

Commit

Permalink
revert rtlsupport change
Browse files Browse the repository at this point in the history
fix instaswap direct access selected iso
remove duplicate tournament mappings
  • Loading branch information
MIPPL committed Sep 1, 2020
1 parent 7c73fab commit 26b1e2b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId = 'com.wagerrwallet'
minSdkVersion 23
targetSdkVersion 28
versionCode 281
versionName "281"
versionCode 282
versionName "282"
multiDexEnabled true

// Similar to other properties in the defaultConfig block,
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
android:label="@string/app_name"
android:largeHeap="true"
android:launchMode="singleTask"
android:supportsRtl="false"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:windowSoftInputMode="stateVisible|adjustResize">
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

close = (ImageButton) rootView.findViewById(R.id.close_button);
BaseWalletManager wm = WalletsMaster.getInstance(getActivity()).getCurrentWallet(getActivity());
selectedIso = currency; // fixed by now // = BRSharedPrefs.isCryptoPreferred(getActivity()) ? wm.getIso(getActivity()) : BRSharedPrefs.getPreferredFiatIso(getContext());
selectedIso = (currency!=null) ? currency : "BTC"; // fixed by now // = BRSharedPrefs.isCryptoPreferred(getActivity()) ? wm.getIso(getActivity()) : BRSharedPrefs.getPreferredFiatIso(getContext());
mListDepositCoins.add(selectedIso);
isoButton.setText(selectedIso);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,15 @@ public List<BetMappingEntity> getAllTournaments(Context app, String iso, long sp

cursor = database.rawQuery(QUERY, null);
cursor.moveToFirst();
HashMap<String, String> map = new HashMap<String, String>();
while (!cursor.isAfterLast()) {
BetMappingEntity transactionEntity = cursorToTransaction(app, iso.toUpperCase(), cursor);
transactions.add(transactionEntity);
String hash = cursor.getString(0);
String mappingId = String.valueOf(cursor.getLong(4));
if ( !map.containsKey(mappingId) ) { // avoid duplicate mapping (same id) with different hash
BetMappingEntity transactionEntity = cursorToTransaction(app, iso.toUpperCase(), cursor);
transactions.add(transactionEntity);
map.put(mappingId, hash);
}
cursor.moveToNext();
}
} catch (Exception ex) {
Expand Down Expand Up @@ -278,17 +284,17 @@ public void deleteTxByHash(Context app, String iso, String hash) {
}
}

public void deleteDuplicateMappings(Context app) {
public void deleteDuplicateMappings(Context app, int mappingID) {
Cursor cursor = null;
try {
database = openDatabase();
Log.e(TAG, "mapping transaction deleted" );
String QUERY = "delete from "+BRSQLiteHelper.BMTX_TABLE_NAME+" where " + BRSQLiteHelper.BMTX_COLUMN_ID + " in (select " + BRSQLiteHelper.BMTX_COLUMN_ID + " "
+ "from "+BRSQLiteHelper.BMTX_TABLE_NAME+" where "+ BRSQLiteHelper.BMTX_MAPPINGID +" in "
+ "(select "+ BRSQLiteHelper.BMTX_MAPPINGID +" from "+BRSQLiteHelper.BMTX_TABLE_NAME+" where " + BRSQLiteHelper.BMTX_NAMESPACEID +"=3 "
+ "(select "+ BRSQLiteHelper.BMTX_MAPPINGID +" from "+BRSQLiteHelper.BMTX_TABLE_NAME+" where " + BRSQLiteHelper.BMTX_NAMESPACEID +"="+mappingID+" "
+ "group by " + BRSQLiteHelper.BMTX_NAMESPACEID + ", " + BRSQLiteHelper.BMTX_MAPPINGID + " "
+ "having count(*)>1) "
+ "and " + BRSQLiteHelper.BMTX_COLUMN_ID + " not in (select max(" + BRSQLiteHelper.BMTX_COLUMN_ID + ") from "+BRSQLiteHelper.BMTX_TABLE_NAME+" where "+ BRSQLiteHelper.BMTX_NAMESPACEID +"=3 "
+ "and " + BRSQLiteHelper.BMTX_COLUMN_ID + " not in (select max(" + BRSQLiteHelper.BMTX_COLUMN_ID + ") from "+BRSQLiteHelper.BMTX_TABLE_NAME+" where "+ BRSQLiteHelper.BMTX_NAMESPACEID +"= "+mappingID+" "
+ "group by " + BRSQLiteHelper.BMTX_NAMESPACEID + ", " + BRSQLiteHelper.BMTX_MAPPINGID + " "
+ "having count(*)>1) )";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ protected void CleanChainBugs(Context app) {
bm.deleteTxByHash(app,"wgr", "e4e3a4f782569fa3bf0135297942c8a1c791ec869ca036bf530ab95633d17815");

// duplicate mappings
bm.deleteDuplicateMappings(app);
//bm.deleteDuplicateMappings(app, BetMappingEntity.MappingNamespaceType.SPORT.getNumber());
//bm.deleteDuplicateMappings(app, BetMappingEntity.MappingNamespaceType.TOURNAMENT.getNumber());
}

@Override
Expand Down

0 comments on commit 26b1e2b

Please sign in to comment.