diff options
author | Florian Dold <florian@dold.me> | 2021-10-19 23:26:29 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-10-19 23:26:29 +0200 |
commit | 6c5d32be7458a6423b8a2b0ab8c3002394620f14 (patch) | |
tree | 773d618f52e32f2478e280a5953f2b832d52065d /packages/anastasis-webui | |
parent | 5dc008939237c29fdfd146ddb1adc09054950459 (diff) |
anastasis-core: compatible secret upload
Diffstat (limited to 'packages/anastasis-webui')
-rw-r--r-- | packages/anastasis-webui/src/hooks/use-anastasis-reducer.ts | 2 | ||||
-rw-r--r-- | packages/anastasis-webui/src/pages/home/SecretEditorScreen.tsx | 23 |
2 files changed, 13 insertions, 12 deletions
diff --git a/packages/anastasis-webui/src/hooks/use-anastasis-reducer.ts b/packages/anastasis-webui/src/hooks/use-anastasis-reducer.ts index 72424e82a..4a242a2e5 100644 --- a/packages/anastasis-webui/src/hooks/use-anastasis-reducer.ts +++ b/packages/anastasis-webui/src/hooks/use-anastasis-reducer.ts @@ -3,7 +3,7 @@ import { BackupStates, getBackupStartState, getRecoveryStartState, RecoveryState import { useState } from "preact/hooks"; const reducerBaseUrl = "http://localhost:5000/"; -const remoteReducer = true; +const remoteReducer = false; interface AnastasisState { reducerState: ReducerState | undefined; diff --git a/packages/anastasis-webui/src/pages/home/SecretEditorScreen.tsx b/packages/anastasis-webui/src/pages/home/SecretEditorScreen.tsx index 2963930fd..086d4921d 100644 --- a/packages/anastasis-webui/src/pages/home/SecretEditorScreen.tsx +++ b/packages/anastasis-webui/src/pages/home/SecretEditorScreen.tsx @@ -1,20 +1,19 @@ /* eslint-disable @typescript-eslint/camelcase */ -import { - encodeCrock, - stringToBytes -} from "@gnu-taler/taler-util"; +import { encodeCrock, stringToBytes } from "@gnu-taler/taler-util"; import { h, VNode } from "preact"; import { useState } from "preact/hooks"; -import { BackupReducerProps, AnastasisClientFrame, LabeledInput } from "./index"; +import { + BackupReducerProps, + AnastasisClientFrame, + LabeledInput, +} from "./index"; export function SecretEditorScreen(props: BackupReducerProps): VNode { const { reducer } = props; const [secretName, setSecretName] = useState( - props.backupState.secret_name ?? "" - ); - const [secretValue, setSecretValue] = useState( - props.backupState.core_secret?.value ?? "" ?? "" + props.backupState.secret_name ?? "", ); + const [secretValue, setSecretValue] = useState(""); const secretNext = (): void => { reducer.runTransaction(async (tx) => { await tx.transition("enter_secret_name", { @@ -41,12 +40,14 @@ export function SecretEditorScreen(props: BackupReducerProps): VNode { <LabeledInput label="Secret Name:" grabFocus - bind={[secretName, setSecretName]} /> + bind={[secretName, setSecretName]} + /> </div> <div> <LabeledInput label="Secret Value:" - bind={[secretValue, setSecretValue]} /> + bind={[secretValue, setSecretValue]} + /> </div> </AnastasisClientFrame> ); |