Only show update message to admins
This commit is contained in:
parent
8f1feb9e45
commit
3da8fca754
|
|
@ -776,6 +776,9 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
|
||||||
? isWhiteLabeled
|
? isWhiteLabeled
|
||||||
: ((isProPlan || isEnterprisePlan) && !isTrial);
|
: ((isProPlan || isEnterprisePlan) && !isTrial);
|
||||||
|
|
||||||
|
bool get isUpdateAvailable =>
|
||||||
|
isSelfHosted && account.isUpdateAvailable && userCompany.isAdmin;
|
||||||
|
|
||||||
bool get isUserConfirmed {
|
bool get isUserConfirmed {
|
||||||
if (isSelfHosted) {
|
if (isSelfHosted) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -808,7 +808,7 @@ class SidebarFooter extends StatelessWidget {
|
||||||
clearErrorOnDismiss: true,
|
clearErrorOnDismiss: true,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
else if (state.isSelfHosted && account.isUpdateAvailable)
|
else if (state.isSelfHosted && state.isUpdateAvailable)
|
||||||
IconButton(
|
IconButton(
|
||||||
tooltip: localization.updateAvailable,
|
tooltip: localization.updateAvailable,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
|
|
@ -966,8 +966,6 @@ class SidebarFooterCollapsed extends StatelessWidget {
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context);
|
||||||
final Store<AppState> store = StoreProvider.of<AppState>(context);
|
final Store<AppState> store = StoreProvider.of<AppState>(context);
|
||||||
final state = store.state;
|
final state = store.state;
|
||||||
final isUpdateAvailable =
|
|
||||||
state.isSelfHosted && state.account.isUpdateAvailable;
|
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
|
|
@ -976,7 +974,7 @@ class SidebarFooterCollapsed extends StatelessWidget {
|
||||||
child: state.uiState.filterEntityType != null &&
|
child: state.uiState.filterEntityType != null &&
|
||||||
state.prefState.isFilterVisible
|
state.prefState.isFilterVisible
|
||||||
? PopupMenuButton<String>(
|
? PopupMenuButton<String>(
|
||||||
icon: isUpdateAvailable
|
icon: state.isUpdateAvailable
|
||||||
? Icon(Icons.warning,
|
? Icon(Icons.warning,
|
||||||
color: Theme.of(context).colorScheme.secondary)
|
color: Theme.of(context).colorScheme.secondary)
|
||||||
: Icon(Icons.info_outline),
|
: Icon(Icons.info_outline),
|
||||||
|
|
@ -990,7 +988,7 @@ class SidebarFooterCollapsed extends StatelessWidget {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
itemBuilder: (BuildContext context) => [
|
itemBuilder: (BuildContext context) => [
|
||||||
if (isUpdateAvailable)
|
if (state.isUpdateAvailable)
|
||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: Icon(
|
leading: Icon(
|
||||||
|
|
@ -1034,7 +1032,7 @@ class SidebarFooterCollapsed extends StatelessWidget {
|
||||||
: IconButton(
|
: IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.chevron_right,
|
Icons.chevron_right,
|
||||||
color: isUpdateAvailable ? state.accentColor : null,
|
color: state.isUpdateAvailable ? state.accentColor : null,
|
||||||
),
|
),
|
||||||
tooltip: localization.showMenu,
|
tooltip: localization.showMenu,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
@ -1291,7 +1289,7 @@ void _showAbout(BuildContext context) async {
|
||||||
),
|
),
|
||||||
if (!state.account.disableAutoUpdate)
|
if (!state.account.disableAutoUpdate)
|
||||||
AppButton(
|
AppButton(
|
||||||
label: (state.account.isUpdateAvailable
|
label: (state.isUpdateAvailable
|
||||||
? localization.updateApp
|
? localization.updateApp
|
||||||
: localization.forceUpdate)
|
: localization.forceUpdate)
|
||||||
.toUpperCase(),
|
.toUpperCase(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue