mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
fix UI api
This commit is contained in:
@@ -714,6 +714,8 @@ mixin class _JsUiApi {
|
||||
var content = message['content'];
|
||||
var actions = <String, JSAutoFreeFunction>{};
|
||||
for (var action in message['actions']) {
|
||||
// [message] will be released after the method call, causing the action to be invalid, so we need to duplicate it
|
||||
(action['callback'] as JSInvokable).dup();
|
||||
actions[action['text']] = JSAutoFreeFunction(action['callback']);
|
||||
}
|
||||
showDialog(context: App.rootContext, builder: (context) {
|
||||
@@ -724,6 +726,7 @@ mixin class _JsUiApi {
|
||||
return TextButton(
|
||||
onPressed: () {
|
||||
entry.value.call([]);
|
||||
context.pop();
|
||||
},
|
||||
child: Text(entry.key),
|
||||
);
|
||||
|
Reference in New Issue
Block a user