IAP fixes
This commit is contained in:
parent
ab29270b68
commit
182ba05d02
|
|
@ -12,6 +12,10 @@ class WebClient {
|
|||
|
||||
String _checkUrl(String url) {
|
||||
if (!url.startsWith('http')) {
|
||||
if (!url.contains('/api/v1')) {
|
||||
url = '/api/v1' + url;
|
||||
}
|
||||
|
||||
url = kAppUrl + url;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,11 +32,8 @@ void _saveAuthLocal(
|
|||
{String email = '', String url = '', String secret = ''}) async {
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
prefs.setString(kSharedPrefEmail, email ?? '');
|
||||
|
||||
if (cleanApiUrl(url).isNotEmpty && cleanApiUrl(url) != kAppUrl) {
|
||||
prefs.setString(kSharedPrefUrl, formatApiUrl(url));
|
||||
prefs.setString(kSharedPrefSecret, secret);
|
||||
}
|
||||
prefs.setString(kSharedPrefUrl, formatApiUrl(url));
|
||||
prefs.setString(kSharedPrefSecret, secret);
|
||||
}
|
||||
|
||||
void _loadAuthLocal(Store<AppState> store) async {
|
||||
|
|
@ -125,9 +122,7 @@ Middleware<AppState> _createSignUpRequest(AuthRepository repository) {
|
|||
lastName: action.lastName,
|
||||
)
|
||||
.then((data) {
|
||||
_saveAuthLocal(
|
||||
email: action.email,
|
||||
);
|
||||
_saveAuthLocal(email: action.email, secret: '', url: '');
|
||||
|
||||
store.dispatch(
|
||||
LoadAccountSuccess(completer: action.completer, loginResponse: data));
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@ AuthState clearAuthErrorReducer(AuthState authState, ClearAuthError action) {
|
|||
|
||||
AuthState userSignUpRequestReducer(
|
||||
AuthState authState, UserSignUpRequest action) {
|
||||
return authState.rebuild((b) => b..url = null);
|
||||
return authState.rebuild((b) => b
|
||||
..url = ''
|
||||
..secret = '');
|
||||
}
|
||||
|
||||
AuthState userLoginLoadedReducer(AuthState authState, UserLoginLoaded action) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,9 @@ class _UpgradeDialogState extends State<UpgradeDialog> {
|
|||
final data = {
|
||||
'order_id': purchase.purchaseID,
|
||||
'product_id': purchase.productID,
|
||||
'timestamp': (int.parse(purchase.transactionDate) / 1000).floor(),
|
||||
'timestamp': Platform.isIOS
|
||||
? (int.parse(purchase.transactionDate) / 1000).floor()
|
||||
: purchase.transactionDate,
|
||||
};
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue