From f49df12b441a2bd06520df42ddd41fc42f639147 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Wed, 24 Nov 2021 17:38:39 -0300
Subject: restore and save session

---
 packages/anastasis-webui/src/pages/home/StartScreen.tsx | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'packages/anastasis-webui/src/pages/home/StartScreen.tsx')

diff --git a/packages/anastasis-webui/src/pages/home/StartScreen.tsx b/packages/anastasis-webui/src/pages/home/StartScreen.tsx
index 8b24ef684..628ae4a34 100644
--- a/packages/anastasis-webui/src/pages/home/StartScreen.tsx
+++ b/packages/anastasis-webui/src/pages/home/StartScreen.tsx
@@ -1,4 +1,6 @@
 import { h, VNode } from "preact";
+import { FileInput } from "../../components/fields/FileInput";
+import { FileButton } from "../../components/FlieButton";
 import { useAnastasisContext } from "../../context/anastasis";
 import { AnastasisClientFrame } from "./index";
 
@@ -34,6 +36,15 @@ export function StartScreen(): VNode {
               <span>Recover a secret</span>
             </button>
 
+            <FileButton
+              label="Restore a session"
+              onChange={(content) => {
+                if (content?.type === "application/json") {
+                  reducer.importState(content.content);
+                }
+              }}
+            />
+
             {/* <button class="button">
               <div class="icon"><i class="mdi mdi-file" /></div>
               <span>Restore a session</span>
-- 
cgit v1.2.3

