Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Sep 18, 2023
2 parents 6c6584f + ef4ff0f commit 07a5a18
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 20 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle.dev
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
defaultConfig {
applicationId "com.invoiceninja.app"
minSdkVersion 19
targetSdkVersion 31
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle.prod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ android {
defaultConfig {
applicationId "com.invoiceninja.app"
minSdkVersion 19
targetSdkVersion 31
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
7 changes: 4 additions & 3 deletions lib/redux/app/app_middleware.dart
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,10 @@ Middleware<AppState> _createViewMainScreen() {
final action = dynamicAction as ViewMainScreen;

if (store.state.uiState.currentRoute == LoginScreen.route) {
store.dispatch(UpdateCurrentRoute(store.state.userCompany.canViewDashboard
? DashboardScreenBuilder.route
: ClientScreen.route));
store.dispatch(UpdateCurrentRoute(
store.state.userCompany.canViewDashboard || store.state.isDemo
? DashboardScreenBuilder.route
: ClientScreen.route));
}

while (navigatorKey.currentState.canPop()) {
Expand Down
25 changes: 18 additions & 7 deletions lib/ui/app/menu_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,31 @@ class _MenuDrawerState extends State<MenuDrawer> {
return Container();
}

Widget _companyLogo(CompanyEntity company) => company
.settings.companyLogo !=
null &&
company.settings.companyLogo.isNotEmpty
? CachedImage(
Widget _companyLogo(CompanyEntity company) {
if (company.settings.companyLogo != null &&
company.settings.companyLogo.isNotEmpty) {
if (state.isHosted && kIsWeb) {
// Fix for CORS error using 'object' subdomain
return CachedImage(
width: MenuDrawer.LOGO_WIDTH,
url: state.credentials.url + '/companies/' + company.id + '/logo',
apiToken: state.userCompanyStates
.firstWhere((userCompanyState) =>
userCompanyState.company.id == company.id)
.token
.token,
)
: Image.asset('assets/images/icon.png', width: MenuDrawer.LOGO_WIDTH);
);
} else {
return CachedImage(
width: MenuDrawer.LOGO_WIDTH,
url: company.settings.companyLogo,
);
}
} else {
return Image.asset('assets/images/icon.png',
width: MenuDrawer.LOGO_WIDTH);
}
}

Widget _companyListItem(
CompanyEntity company, {
Expand Down
23 changes: 15 additions & 8 deletions lib/ui/settings/company_details.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Flutter imports:
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:invoiceninja_flutter/constants.dart';
Expand Down Expand Up @@ -572,14 +573,20 @@ class _CompanyDetailsState extends State<CompanyDetails>
if ('${settings.companyLogo ?? ''}'.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: CachedImage(
width: double.infinity,
url: state.credentials.url +
'/companies/' +
company.id +
'/logo',
apiToken: state.userCompany.token.token,
)),
// Fix for CORS error using 'object' subdomain
child: (state.isHosted && kIsWeb)
? CachedImage(
width: double.infinity,
url: state.credentials.url +
'/companies/' +
company.id +
'/logo',
apiToken: state.userCompany.token.token,
)
: CachedImage(
width: double.infinity,
url: company.settings.companyLogo,
)),
],
),
),
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/i18n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
// STARTER: lang key - do not remove comment
'expense_status_4': 'Unpaid',
'expense_status_5': 'Paid',
'recurring': 'Recurring',
'ziptax_help':
'Note: this feature requires a Zip-Tax API key to lookup US sales tax by address',
Expand Down

0 comments on commit 07a5a18

Please sign in to comment.