From bbde2a9bb9fcb8d008b67a4382b15864a9ef2e9b Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Mon, 3 Oct 2022 18:26:37 -0300
Subject: fix: showing start again in the last main screen

---
 .../src/components/menu/SideBar.tsx                | 41 +++++++++++++++-------
 1 file changed, 29 insertions(+), 12 deletions(-)

(limited to 'packages/anastasis-webui/src/components/menu/SideBar.tsx')

diff --git a/packages/anastasis-webui/src/components/menu/SideBar.tsx b/packages/anastasis-webui/src/components/menu/SideBar.tsx
index 91b49f9ce..51e854944 100644
--- a/packages/anastasis-webui/src/components/menu/SideBar.tsx
+++ b/packages/anastasis-webui/src/components/menu/SideBar.tsx
@@ -190,6 +190,19 @@ export function Sidebar({ mobile }: Props): VNode {
                   </div>
                 </li>
               )}
+              {reducer.currentReducerState.backup_state !==
+                BackupStates.BackupFinished && (
+                <li>
+                  <div class="buttons ml-4">
+                    <button
+                      class="button is-danger is-right"
+                      onClick={() => reducer.reset()}
+                    >
+                      Reset session
+                    </button>
+                  </div>
+                </li>
+              )}
             </Fragment>
           ) : (
             reducer.currentReducerState?.reducer_type === "recovery" && (
@@ -281,21 +294,25 @@ export function Sidebar({ mobile }: Props): VNode {
                     </div>
                   </li>
                 )}
+                {reducer.currentReducerState.recovery_state ===
+                RecoveryStates.RecoveryFinished ? (
+                  <Fragment />
+                ) : (
+                  <li>
+                    <div class="buttons ml-4">
+                      <button
+                        class="button is-danger is-right"
+                        onClick={() => reducer.reset()}
+                      >
+                        Reset session
+                      </button>
+                    </div>
+                  </li>
+                )}
               </Fragment>
             )
           )}
-          {reducer.currentReducerState && (
-            <li>
-              <div class="buttons ml-4">
-                <button
-                  class="button is-danger is-right"
-                  onClick={() => reducer.reset()}
-                >
-                  Start again
-                </button>
-              </div>
-            </li>
-          )}
+
           {/* <li>
               <div class="buttons ml-4">
                 <button class="button is-info is-right" >Manage providers</button>
-- 
cgit v1.2.3

