From 93dbf2c2c99fa5225f20b3b78593b97b8115668e Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Mon, 26 Sep 2022 09:24:05 -0300
Subject: showing restore and save, but removing from the ending state

---
 .../src/components/menu/SideBar.tsx                | 46 ++++++++++++----------
 1 file changed, 26 insertions(+), 20 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 4c1d085ee..91b49f9ce 100644
--- a/packages/anastasis-webui/src/components/menu/SideBar.tsx
+++ b/packages/anastasis-webui/src/components/menu/SideBar.tsx
@@ -177,16 +177,19 @@ export function Sidebar({ mobile }: Props): VNode {
                 <span class="menu-item-label"><Translate>Truth Paying</Translate></span>
               </div>
             </li> */}
-              {/* <li>
-                <div class="buttons ml-4">
-                  <button
-                    class="button is-primary is-right"
-                    onClick={saveSession}
-                  >
-                    Save backup session
-                  </button>
-                </div>
-              </li> */}
+              {reducer.currentReducerState.backup_state !==
+                BackupStates.BackupFinished && (
+                <li>
+                  <div class="buttons ml-4">
+                    <button
+                      class="button is-primary is-right"
+                      onClick={saveSession}
+                    >
+                      Save backup session
+                    </button>
+                  </div>
+                </li>
+              )}
             </Fragment>
           ) : (
             reducer.currentReducerState?.reducer_type === "recovery" && (
@@ -265,16 +268,19 @@ export function Sidebar({ mobile }: Props): VNode {
                     </span>
                   </div>
                 </li>
-                {/* <li>
-                  <div class="buttons ml-4">
-                    <button
-                      class="button is-primary is-right"
-                      onClick={saveSession}
-                    >
-                      Save recovery session
-                    </button>
-                  </div>
-                </li> */}
+                {reducer.currentReducerState.recovery_state !==
+                  RecoveryStates.RecoveryFinished && (
+                  <li>
+                    <div class="buttons ml-4">
+                      <button
+                        class="button is-primary is-right"
+                        onClick={saveSession}
+                      >
+                        Save recovery session
+                      </button>
+                    </div>
+                  </li>
+                )}
               </Fragment>
             )
           )}
-- 
cgit v1.2.3

