Reset new room dialog after state is retrieved
This commit is contained in:
parent
3e224af49e
commit
bde79fcc85
2 changed files with 9 additions and 12 deletions
|
@ -385,10 +385,13 @@ impl AppOp {
|
|||
.expect("Can't find private_visibility_button in ui file.");
|
||||
|
||||
let name = name_entry.get_text().to_string();
|
||||
name_entry.set_text("");
|
||||
|
||||
// Since the switcher
|
||||
let privacy = if private.get_active() {
|
||||
room::RoomType::Private
|
||||
} else {
|
||||
private.set_active(true);
|
||||
room::RoomType::Public
|
||||
};
|
||||
|
||||
|
|
|
@ -43,20 +43,14 @@ pub fn connect(ui: &UI, app_runtime: AppRuntime) {
|
|||
}),
|
||||
);
|
||||
|
||||
confirm.connect_clicked(
|
||||
clone!(@strong entry, @strong dialog, @strong private, @strong app_runtime => move |_| {
|
||||
dialog.hide();
|
||||
app_runtime.update_state_with(|state| state.create_new_room());
|
||||
entry.set_text("");
|
||||
private.set_active(true);
|
||||
}),
|
||||
);
|
||||
|
||||
entry.connect_activate(clone!(@strong dialog => move |entry| {
|
||||
confirm.connect_clicked(clone!(@strong dialog, @strong app_runtime => move |_| {
|
||||
dialog.hide();
|
||||
app_runtime.update_state_with(|state| state.create_new_room());
|
||||
}));
|
||||
|
||||
entry.connect_activate(clone!(@strong dialog => move |_| {
|
||||
dialog.hide();
|
||||
app_runtime.update_state_with(|state| state.create_new_room());
|
||||
entry.set_text("");
|
||||
private.set_active(true);
|
||||
}));
|
||||
entry.connect_changed(clone!(@strong confirm => move |entry| {
|
||||
confirm.set_sensitive(entry.get_buffer().get_length() > 0);
|
||||
|
|
Loading…
Reference in a new issue