update
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run

This commit is contained in:
2026-11-19 10:37:22 +07:00
parent c7c1d0c741
commit 2a9d42a612
29 changed files with 532 additions and 425 deletions
+6 -9
View File
@@ -6,15 +6,15 @@ use gpui::{
use signed_state::Backend;
use ui::button::Button;
use ui::common::v_flex;
use ui::dialog::Dialog;
use ui::dialog::{Dialog, DialogHandle};
use ui::field::Field;
use ui::input::{Input, InputState};
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
use crate::shared::dialogs::close_global;
use crate::shared::progress::{DialogProgress, error_row};
pub struct OnboardingDialog {
handle: DialogHandle,
name_input: Entity<InputState>,
pass_input: Entity<InputState>,
repass_input: Entity<InputState>,
@@ -29,6 +29,7 @@ impl OnboardingDialog {
let repass_input = InputState::builder().password().build(cx);
cx.new(|_| Self {
handle: DialogHandle::new(true),
name_input,
pass_input,
repass_input,
@@ -61,9 +62,10 @@ impl OnboardingDialog {
let backend = Backend::global(cx);
let task = backend.update(cx, |backend, cx| backend.create_identity(&name, &pass, cx));
let state = self.state.clone();
let handle = self.handle.clone();
cx.spawn(async move |_this, cx| match task.await {
Ok(_) => cx.update(close_global),
Ok(_) => cx.update(|cx| handle.close(cx)),
Err(error) => {
state.update(cx, |state, cx| {
state.fail(error.to_string());
@@ -85,13 +87,8 @@ impl Render for OnboardingDialog {
let this = cx.entity().downgrade();
Dialog::new("onboarding-dialog")
.open(true)
.handle(self.handle.clone())
.min_width(px(520.))
.on_change(|open, _, cx| {
if !open {
close_global(cx);
}
})
.title("Create identity")
.content(move |_window, cx| {
let progress = state.read(cx);