public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve_flutter_frontend] main: add check to show welcome screen only when no server configured
Date: Mon, 14 Dec 2020 09:59:52 +0100	[thread overview]
Message-ID: <20201214085952.30932-1-a.lauterer@proxmox.com> (raw)

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





                 reply	other threads:[~2020-12-14  8:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201214085952.30932-1-a.lauterer@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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