Skip to content

Commit 89fa4af

Browse files
committed
🐞 Fix: RNIContextMenuView provideDeferredElements View Command
1 parent 83071ea commit 89fa4af

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

ios/RNIContextMenuView/RNIContextMenuViewContent.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -735,22 +735,27 @@ extension RNIContextMenuViewContent: RNIContentViewDelegate {
735735
resolveBlock([:]);
736736

737737
case "provideDeferredElements":
738-
let id: String =
739-
try commandArguments.getValueFromDictionary(forKey: "id");
738+
let deferredID: String =
739+
try commandArguments.getValueFromDictionary(forKey: "deferredID");
740740

741741
let menuElementsRaw: [Any] =
742-
try commandArguments.getValueFromDictionary(forKey: "menuElements");
742+
try commandArguments.getValueFromDictionary(forKey: "menuItems");
743743

744744
let menuElements: [RNIMenuElement] = menuElementsRaw.compactMap {
745745
guard let dict = $0 as? Dictionary<String, Any> else {
746746
return nil;
747747
};
748748

749-
return .init(dictionary: dict);
749+
return (
750+
RNIMenuItem(dictionary: dict)
751+
?? RNIMenuActionItem(dictionary: dict)
752+
?? RNIDeferredMenuElement(dictionary: dict)
753+
?? RNIMenuElement(dictionary: dict)
754+
);
750755
};
751756

752757
try self.provideDeferredElements(
753-
id: id,
758+
id: deferredID,
754759
menuElements: menuElements
755760
);
756761

0 commit comments

Comments
 (0)