Skip to content

Commit

Permalink
🐞 Fix: RNIModalSheetView.onModalSheetStateDidChange Event
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Sep 29, 2024
1 parent 432a15a commit 65b307a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ios/RNIModalSheetView/RNIModalSheetViewDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,16 @@ extension RNIModalSheetViewDelegate: ModalSheetPresentationStateEventsNotifiable
prevState: ModalSheetState?,
currentState: ModalSheetState
) {
let payload: Dictionary<String, Any> = [
"prevState": currentState.asDictionary,
var payload: Dictionary<String, Any> = [
"currentState": currentState.asDictionary
];

payload.unwrapAndMerge(withOther: [
"prevState": prevState?.asDictionary
]);

self.dispatchEvent(
for: .onModalSheetStateWillChange,
for: .onModalSheetStateDidChange,
withPayload: payload
);
};
Expand Down
4 changes: 4 additions & 0 deletions ios/Temp/ModalSheetPresentationStateMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public class ModalSheetPresentationStateMachine {
// ---------------

public func setStateExplicit(nextState: ModalSheetState){
guard self.currentState != nextState else {
return;
};

let prevState = self.prevState;
let currentState = self.currentState;

Expand Down

0 comments on commit 65b307a

Please sign in to comment.