Skip to content

Commit da36d8a

Browse files
committed
cleanup
1 parent f9841d9 commit da36d8a

10 files changed

+0
-198
lines changed

src/CryptoSetup/EnablingRecoveryStepViewModel.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ export class EnablingRecoveryStepViewModel
9292
});
9393
break;
9494
case EnableRecoveryProgress_Tags.Done:
95-
console.log(
96-
"Recovery setup complete! Recovery key:",
97-
progress.inner.recoveryKey,
98-
);
9995
this.complete({
10096
outcome: "complete",
10197
recoveryKey: progress.inner.recoveryKey,

src/CryptoSetup/EncryptionFlowViewModel.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ export class EncryptionFlowViewModel
116116
}
117117

118118
private cleanup(): void {
119-
console.log("[EncryptionFlow] cleanup - clearing state");
120119
this.snapshot.merge({
121120
currentScreen: null,
122121
screenType: null,
@@ -128,22 +127,18 @@ export class EncryptionFlowViewModel
128127
* Start the encryption flow. Runs until complete or user cancels.
129128
*/
130129
public async startFlow(): Promise<EncryptionFlowResult> {
131-
console.log("[EncryptionFlow] startFlow called");
132130
this.cancelled = false;
133131
this.snapshot.merge({ isActive: true, isLoading: true });
134-
console.log("[EncryptionFlow] Set isActive: true, isLoading: true");
135132

136133
try {
137134
// Check initial state to determine available options
138-
console.log("[EncryptionFlow] Checking initial state...");
139135
const [backupExistsOnServer, hasDevicesToVerifyAgainst] = await Promise.all([
140136
this.checkBackupExistsOnServer(),
141137
this.checkHasDevicesToVerifyAgainst(),
142138
]);
143139

144140
const recoveryState = this.encryption.recoveryState();
145141
// RecoveryState: Unknown=0, Enabled=1, Disabled=2, Incomplete=3
146-
console.log("[EncryptionFlow] Initial state:", { backupExistsOnServer, hasDevicesToVerifyAgainst, recoveryState });
147142

148143
// Compute available actions
149144
const availableActions: IdentityConfirmationAction[] = [];
@@ -157,11 +152,8 @@ export class EncryptionFlowViewModel
157152
availableActions.push(IdentityConfirmationAction.Recovery);
158153
}
159154

160-
console.log("[EncryptionFlow] Available actions:", availableActions);
161-
162155
// Always run the confirm identity flow - even if no actions available,
163156
// the user can still choose "Can't confirm" which leads to reset
164-
console.log("[EncryptionFlow] Starting confirm identity flow");
165157
while (!this.cancelled) {
166158
const confirmResult = await this.runConfirmIdentityStep(availableActions);
167159

@@ -196,7 +188,6 @@ export class EncryptionFlowViewModel
196188
if (outcome === "interactiveVerification") {
197189
// TODO: Implement interactive verification
198190
// For now, just continue the loop
199-
console.log("Interactive verification not yet implemented");
200191
continue;
201192
}
202193

@@ -221,7 +212,6 @@ export class EncryptionFlowViewModel
221212
return { type: "cancelled" };
222213
} catch (e) {
223214
printRustError("Encryption flow failed", e);
224-
console.log("[EncryptionFlow] Error in startFlow:", e);
225215
this.cleanup();
226216
return { type: "cancelled" };
227217
}
@@ -252,18 +242,15 @@ export class EncryptionFlowViewModel
252242
| { type: "back" }
253243
| { type: "cancel" }
254244
> {
255-
console.log("[EncryptionFlow] runConfirmIdentityStep - creating VM");
256245
const vm = new ConfirmIdentityStepViewModel({
257246
availableActions,
258247
});
259248

260-
console.log("[EncryptionFlow] runConfirmIdentityStep - setting currentScreen and isLoading: false");
261249
this.snapshot.merge({
262250
currentScreen: vm as FlowStepViewModel<unknown, unknown, unknown>,
263251
screenType: vm.screenType,
264252
isLoading: false,
265253
});
266-
console.log("[EncryptionFlow] runConfirmIdentityStep - state updated, waiting for result");
267254

268255
return vm.result as Promise<
269256
| { type: "success"; data: { outcome: "useRecoveryKey" | "interactiveVerification" | "resetIdentity" } }
@@ -406,7 +393,6 @@ export class EncryptionFlowViewModel
406393
const raceResult = await Promise.race([oidcPromise, userActionPromise]);
407394

408395
if (raceResult.type === "oidc-complete") {
409-
console.log("OIDC reset complete");
410396
if (popup && !popup.closed) {
411397
popup.close();
412398
}
@@ -469,20 +455,16 @@ export class EncryptionFlowViewModel
469455
}
470456

471457
private async runSetupRecoveryFlow(): Promise<EncryptionFlowResult> {
472-
console.log("[EncryptionFlow] runSetupRecoveryFlow - creating SetupRecoveryStepViewModel");
473458
// Show setup recovery step
474459
const setupVm = new SetupRecoveryStepViewModel({});
475460

476-
console.log("[EncryptionFlow] runSetupRecoveryFlow - setting currentScreen and isLoading: false");
477461
this.snapshot.merge({
478462
currentScreen: setupVm as FlowStepViewModel<unknown, unknown, unknown>,
479463
screenType: setupVm.screenType,
480464
isLoading: false,
481465
});
482466

483-
console.log("[EncryptionFlow] runSetupRecoveryFlow - waiting for setupVm.result");
484467
const setupResult = await setupVm.result;
485-
console.log("[EncryptionFlow] runSetupRecoveryFlow - setupResult:", setupResult);
486468

487469
if (setupResult.type !== "success") {
488470
return { type: "cancelled" };

src/CryptoSetup/RecoveryKeyEntryStepViewModel.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export class RecoveryKeyEntryStepViewModel
7777

7878
try {
7979
await this.props.encryption.recover(recoveryKey);
80-
console.log("Recovery successful");
8180
this.complete({ outcome: "verified" });
8281
} catch (e) {
8382
printRustError("Failed to recover", e);

src/CryptoSetup/ResetIdentityExecuteStepViewModel.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,16 @@ export class ResetIdentityExecuteStepViewModel
7575
this.snapshot.merge({ isResetting: true, error: null });
7676

7777
try {
78-
console.log("Executing identity reset...");
7978
const handle = await this.props.encryption.resetIdentity();
8079

8180
if (!handle) {
8281
// Reset completed without auth
83-
console.log("Reset completed without auth");
8482
this.complete({ outcome: "resetComplete" });
8583
return;
8684
}
8785

8886
// Check auth type
8987
const authType = handle.authType();
90-
console.log("Reset auth type:", authType);
9188

9289
if (authType?.tag === "Oidc") {
9390
// OIDC: Return to flow to handle - will go back to warning screen

src/CryptoSetup/ResetIdentityPasswordStepViewModel.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export class ResetIdentityPasswordStepViewModel
8888
const authData = AuthData.Password.new({ passwordDetails });
8989

9090
await this.props.resetHandle.reset(authData);
91-
console.log("Password reset complete");
9291
this.complete({ outcome: "resetComplete" });
9392
} catch (e) {
9493
printRustError("Failed to reset with password", e);

src/CryptoSetup/encryption-view.types.ts

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/CryptoSetup/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,3 @@ export type { FlowStepResult } from "./FlowStepViewModel";
104104

105105
// Types
106106
export type { ScreenProps } from "./screenRegistry.types";
107-
export {
108-
EncryptionFlow,
109-
} from "./encryption-view.types";
110-
export type { EncryptionViewSnapshot } from "./encryption-view.types";

src/Encryption.module.css

Lines changed: 0 additions & 89 deletions
This file was deleted.

src/Encryption.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,9 @@ export const Encryption: React.FC<EncryptionProps> = ({
5454
encryptionFlowViewModel.setPopupOpener(popupOpener);
5555
}, [encryptionFlowViewModel, popupOpener]);
5656

57-
console.log("[Encryption] Render:", { isLoading, isActive, hasCurrentScreen: !!currentScreen, screenType });
58-
5957
useEffect(() => {
6058
if (!flowStartedRef.current) {
6159
flowStartedRef.current = true;
62-
console.log("[Encryption] Starting flow");
6360
// Start the encryption flow - runs async
6461
encryptionFlowViewModel.startFlow();
6562
}
@@ -70,8 +67,6 @@ export const Encryption: React.FC<EncryptionProps> = ({
7067
// 2. Flow is active but no screen is set yet (race condition protection)
7168
const showLoading = isLoading || (isActive && !currentScreen);
7269

73-
console.log("[Encryption] showLoading:", showLoading, "willShowModal:", isActive && currentScreen && !showLoading);
74-
7570
// Loading state shown in a dialog
7671
const loadingContent = showLoading
7772
? createPortal(

src/Login/OidcLoginViewModel.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ export class OidcLoginViewModel
9393
const authData = await this.props.onGetOidcAuthUrl(server);
9494
const loginUrl = authData.loginUrl();
9595

96-
console.log("Opening OIDC login URL:", loginUrl);
97-
9896
// Open OIDC provider in a popup window
9997
const width = 600;
10098
const height = 700;
@@ -140,7 +138,6 @@ export class OidcLoginViewModel
140138
if (popup.closed) {
141139
cleanup();
142140
if (!loginCompleted) {
143-
console.log("OIDC popup closed - user cancelled");
144141
await this.props.onAbortOidcLogin();
145142
this.snapshot.merge({ loggingIn: false });
146143
}
@@ -172,7 +169,6 @@ export class OidcLoginViewModel
172169

173170
// Check if this is a user cancellation error
174171
if (errorMessage.includes("OidcError.Cancelled")) {
175-
console.log("OIDC login cancelled by user");
176172
await this.props.onAbortOidcLogin();
177173
this.snapshot.merge({ loggingIn: false });
178174
return;

0 commit comments

Comments
 (0)