aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-10-03 18:26:37 -0300
committerSebastian <sebasjm@gmail.com>2022-10-03 18:26:37 -0300
commitbbde2a9bb9fcb8d008b67a4382b15864a9ef2e9b (patch)
treecd314213ac762d5843202444426a8f5da250c860
parent4707c8874293d100239af30809e6df6d5a9bbe68 (diff)
fix: showing start again in the last main screen
-rw-r--r--packages/anastasis-webui/src/components/menu/SideBar.tsx41
-rw-r--r--packages/anastasis-webui/src/pages/home/BackupFinishedScreen.tsx17
-rw-r--r--packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx19
3 files changed, 65 insertions, 12 deletions
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>
diff --git a/packages/anastasis-webui/src/pages/home/BackupFinishedScreen.tsx b/packages/anastasis-webui/src/pages/home/BackupFinishedScreen.tsx
index d69a0af38..9b63c9887 100644
--- a/packages/anastasis-webui/src/pages/home/BackupFinishedScreen.tsx
+++ b/packages/anastasis-webui/src/pages/home/BackupFinishedScreen.tsx
@@ -57,6 +57,23 @@ export function BackupFinishedScreen(): VNode {
</div>
);
})}
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "center",
+ }}
+ >
+ <p>
+ <div class="buttons ml-4">
+ <button
+ class="button is-primary is-right"
+ onClick={() => reducer.reset()}
+ >
+ Start again
+ </button>
+ </div>
+ </p>
+ </div>
</div>
)}
</AnastasisClientFrame>
diff --git a/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx b/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx
index c8615da14..62ac410a2 100644
--- a/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx
+++ b/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx
@@ -95,11 +95,30 @@ export function RecoveryFinishedScreen(): VNode {
<span>Download content</span>
</a>
</div>
+
{plainText ? (
<div class="block">
<QR text={secret} />
</div>
) : undefined}
+
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "center",
+ }}
+ >
+ <p>
+ <div class="buttons ml-4">
+ <button
+ class="button is-primary is-right"
+ onClick={() => reducer.reset()}
+ >
+ Start again
+ </button>
+ </div>
+ </p>
+ </div>
</AnastasisClientFrame>
);
}