Adjust version requirements
This commit is contained in:
parent
6b7d9d5bf3
commit
50b61d33f7
|
|
@ -510,7 +510,7 @@ class _EmailSettingsState extends State<EmailSettings> {
|
|||
onChanged: (value) => viewModel.onSettingsChanged(
|
||||
settings.rebuild((b) => b..ublEmailAttachment = value)),
|
||||
),
|
||||
if (supportsLatestFeatures())
|
||||
if (supportsLatestFeatures(null))
|
||||
BoolDropdownButton(
|
||||
label: localization.enableEInvoice,
|
||||
value: settings.enableEInvoice,
|
||||
|
|
|
|||
|
|
@ -428,7 +428,7 @@ class SettingsSearch extends StatelessWidget {
|
|||
[
|
||||
'tax_settings',
|
||||
'inclusive_taxes',
|
||||
if (supportsLatestFeatures()) 'calculate_taxes#2023-04-26',
|
||||
if (supportsLatestFeatures('5.6.0')) 'calculate_taxes#2023-04-26',
|
||||
],
|
||||
],
|
||||
kSettingsTaxRates: [
|
||||
|
|
@ -623,7 +623,7 @@ class SettingsSearch extends StatelessWidget {
|
|||
'mailgun#2023-01-11',
|
||||
'email_alignment#2023-01-17',
|
||||
'show_email_footer#2023-01-17',
|
||||
if (supportsLatestFeatures()) 'enable_e_invoice#2023-04-27,'
|
||||
if (supportsLatestFeatures(null)) 'enable_e_invoice#2023-04-27,'
|
||||
],
|
||||
],
|
||||
kSettingsTemplatesAndReminders: [
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class _TaxSettingsState extends State<TaxSettings> {
|
|||
onPressed: () => viewModel.onConfigureRatesPressed(context),
|
||||
),
|
||||
),
|
||||
if (supportsLatestFeatures())
|
||||
if (supportsLatestFeatures('5.6.0'))
|
||||
FormCard(
|
||||
isLast: true,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ bool supportsAppleOAuth() => kIsWeb || isApple();
|
|||
// TODO remove this function
|
||||
bool supportsMicrosoftOAuth() => kIsWeb;
|
||||
|
||||
bool supportsLatestFeatures() {
|
||||
bool supportsLatestFeatures(String version) {
|
||||
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
|
||||
final state = store.state;
|
||||
|
||||
|
|
@ -55,8 +55,15 @@ bool supportsLatestFeatures() {
|
|||
return true;
|
||||
}
|
||||
|
||||
return Version.parse(state.account.currentVersion) >=
|
||||
Version.parse('5.5.118');
|
||||
if (state.isSelfHosted) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (version == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Version.parse(state.account.currentVersion) >= Version.parse(version);
|
||||
}
|
||||
|
||||
bool supportsInAppPurchase() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue