fix(ui): drop RefCell borrow before match statement in populate. Extracts model.borrow().kind to a local variable to drop the temporary immutable borrow before entering 'populate_*' arms, preventing a runtime panic when nested functions attempt a mutable borrrow.

This commit is contained in:
Breadway 2026-07-19 14:07:29 +08:00
parent bde95e4bd6
commit 2b174ee792

View file

@ -564,7 +564,9 @@ fn populate(content: &GBox, model: &Rc<RefCell<Model>>, status: &Label) {
Rc::new(move || rerender(&content, &model, &status))
};
match model.borrow().kind {
let kind = model.borrow().kind;
match kind {
SchemaKind::Unknown => populate_unknown(content, status),
SchemaKind::Flat => populate_flat(content, model, status, &rerender),
SchemaKind::MultiLayout => populate_multi_layout(content, model, &rerender),