Преглед на файлове

app: always re-init keyboard on restart

darkfi преди 1 година
родител
ревизия
8b376e11ff
променени са 1 файла, в които са добавени 9 реда и са изтрити 11 реда
  1. 9 11
      bin/app/src/ui/chatedit.rs

+ 9 - 11
bin/app/src/ui/chatedit.rs

@@ -1404,16 +1404,14 @@ impl UIObject for ChatEdit {
 
     fn init(&self) {
         let mut guard = self.editor.lock_blocking();
-        //assert!(guard.is_none());
-        if guard.is_none() {
-            *guard = Some(Editor::new(
-                self.text.clone(),
-                self.font_size.clone(),
-                self.text_color.clone(),
-                self.window_scale.clone(),
-                self.lineheight.clone(),
-            ));
-        }
+        assert!(guard.is_none());
+        *guard = Some(Editor::new(
+            self.text.clone(),
+            self.font_size.clone(),
+            self.text_color.clone(),
+            self.window_scale.clone(),
+            self.lineheight.clone(),
+        ));
     }
 
     async fn start(self: Arc<Self>, ex: ExecutorPtr) {
@@ -1544,7 +1542,7 @@ impl UIObject for ChatEdit {
         *self.parent_rect.lock() = None;
         self.key_repeat.lock().clear();
         *self.cursor_mesh.lock() = None;
-        //*self.editor.lock_blocking() = None;
+        *self.editor.lock_blocking() = None;
     }
 
     async fn draw(