public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH pve_flutter_frontend] main: add check to show welcome screen only when no server configured
@ 2020-12-14  8:59 Aaron Lauterer
  0 siblings, 0 replies; only message in thread
From: Aaron Lauterer @ 2020-12-14  8:59 UTC (permalink / raw)
  To: pve-devel

This additional check will make sure that people who have been using the
app already do not get to see the welcome screen.

In that situation we also want to make sure that we set the shared pref
for the welcome screen to the same state as if it has been seen.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---

I am still unsure if we shouldn't just show the welcome screen to
everyone at least once but that might annoy quite a lot of people though :/

So I prepared this patch should we decide against it.

It needs the following patches applied first [0]

The slightly weird formatting of the if clause is caused by the dart
auto formatter.

[0] https://lists.proxmox.com/pipermail/pve-devel/2020-December/046451.html

 lib/main.dart | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/main.dart b/lib/main.dart
index 57ad39c..4b490e3 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -149,10 +149,13 @@ class MyApp extends StatelessWidget {
               builder: (context) => PveSplashScreen(),
             );
           }
-          if (sharedPreferences.getBool('showWelcomeScreen') ?? true) {
+          if (sharedPreferences.getBool('showWelcomeScreen') ??
+              true && !sharedPreferences.containsKey('ProxmoxLoginList')) {
             return MaterialPageRoute(
               builder: (context) => PveWelcome(),
             );
+          } else if (!sharedPreferences.containsKey('showWelcomeScreen')) {
+            sharedPreferences.setBool('showWelcomeScreen', false);
           }
 
           if (authbloc.state.value is Unauthenticated ||
-- 
2.20.1





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-14  8:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14  8:59 [pve-devel] [PATCH pve_flutter_frontend] main: add check to show welcome screen only when no server configured Aaron Lauterer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal