Skip to content

Commit

Permalink
chore: Add update blockers for app store versions
Browse files Browse the repository at this point in the history
  • Loading branch information
qdot committed Oct 20, 2023
1 parent b6fbf0b commit 70d31f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/page/settings_page.dart
Expand Up @@ -49,7 +49,7 @@ class SettingPage extends StatelessWidget {
child: const Text("Check For Updates"))),
SettingsTile(title: const Text("App Version"), value: Text(cubit.currentAppVersion)),
];
if (isDesktop() && cubit.currentAppVersion != cubit.latestAppVersion) {
if (isDesktop() && canShowUpdate() && cubit.currentAppVersion != cubit.latestAppVersion) {
versionTiles.add(SettingsTile.navigation(
onPressed: (context) async {
const url = "https://github.com/intiface/intiface-central/releases";
Expand Down
1 change: 1 addition & 0 deletions lib/util/intiface_util.dart
Expand Up @@ -81,3 +81,4 @@ class IntifacePaths {

bool isDesktop() => Platform.isLinux || Platform.isMacOS || Platform.isWindows;
bool isMobile() => Platform.isAndroid || Platform.isIOS;
bool canShowUpdate() => !(const bool.fromEnvironment('NO_VISIBLE_UPDATES'));
4 changes: 3 additions & 1 deletion lib/widget/control_widget.dart
Expand Up @@ -147,7 +147,9 @@ class ControlWidget extends StatelessWidget {
);
}),
Visibility(
visible: isDesktop() && configCubit.currentAppVersion != configCubit.latestAppVersion,
visible: isDesktop() &&
canShowUpdate() &&
configCubit.currentAppVersion != configCubit.latestAppVersion,
child: TextButton.icon(
label: const Text("Update"),
onPressed: () => navCubit.goSettings(),
Expand Down

0 comments on commit 70d31f4

Please sign in to comment.