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