File tree 1 file changed +11
-3
lines changed
android/java/org/chromium/chrome/browser/crypto_wallet/util
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1115,23 +1115,31 @@ public static Profile getProfile(boolean isIncognito) {
1115
1115
chromeActivity = BraveActivity .getChromeTabbedActivity ();
1116
1116
}
1117
1117
if (chromeActivity == null ) {
1118
- return ProfileManager . getLastUsedRegularProfile ( ); // Last resort
1118
+ return getLastUsedProfile ( isIncognito ); // Last resort
1119
1119
}
1120
1120
1121
1121
ObservableSupplier <TabModelSelector > supplier =
1122
1122
chromeActivity .getTabModelSelectorSupplier ();
1123
1123
TabModelSelector selector = supplier .get ();
1124
1124
if (selector == null ) {
1125
- return ProfileManager . getLastUsedRegularProfile ( );
1125
+ return getLastUsedProfile ( isIncognito );
1126
1126
}
1127
1127
1128
1128
Profile profile = selector .getModel (isIncognito ).getProfile ();
1129
1129
if (profile == null ) {
1130
- return ProfileManager . getLastUsedRegularProfile ( );
1130
+ return getLastUsedProfile ( isIncognito );
1131
1131
}
1132
1132
return profile ;
1133
1133
}
1134
1134
1135
+ private static Profile getLastUsedProfile (boolean isIncognito ) {
1136
+ if (!isIncognito ) {
1137
+ return ProfileManager .getLastUsedRegularProfile ();
1138
+ } else {
1139
+ return ProfileManager .getLastUsedRegularProfile ().getPrimaryOtrProfile (true );
1140
+ }
1141
+ }
1142
+
1135
1143
public static String formatErc721TokenTitle (String title , String id ) {
1136
1144
if (id .isEmpty () || id .equals ("0" )) {
1137
1145
return title ;
You can’t perform that action at this time.
0 commit comments