update checkout store
This commit is contained in:
@@ -267,23 +267,14 @@ impl SettingsControls {
|
||||
/// Open the Settings dialog.
|
||||
pub fn open(window: &mut Window, cx: &mut App) {
|
||||
let controls = Rc::new(SettingsControls::new(window, cx));
|
||||
let store = SettingsStore::global(cx);
|
||||
let window_handle = window.window_handle();
|
||||
let store_subscription = cx.observe(&store, move |_, cx| {
|
||||
window_handle
|
||||
.update(cx, |_, window, _| window.refresh())
|
||||
.ok();
|
||||
});
|
||||
|
||||
let dialog_state = Rc::new((controls, store_subscription));
|
||||
|
||||
window.open_dialog(cx, move |dialog, _window, cx| {
|
||||
let dialog_state = dialog_state.clone();
|
||||
let controls = controls.clone();
|
||||
dialog
|
||||
.title("Settings")
|
||||
.width(px(650.))
|
||||
.h(px(560.))
|
||||
.child(settings_view(&dialog_state.0, cx))
|
||||
.child(settings_view(&controls, cx))
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user