Skip to content

Commit

Permalink
refactor: changes for recon
Browse files Browse the repository at this point in the history
  • Loading branch information
Riddhiagrawal001 committed Dec 16, 2024
1 parent 19ac308 commit 51ccfdb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/screens/Recon/ReconModule.res
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ let make = (~urlList) => {
->safeParse
->getDictFromJsonObject
->getString("event", "")
->ReconUtils.getEventTypeFromString

let status =
dictFromEvent
Expand All @@ -60,7 +61,7 @@ let make = (~urlList) => {
->getString("AuthenticationStatus", "")
->ReconUtils.getAuthStatusFromMessage

if eventType == "AuthenticationStatus" && status == IframeLoggedOut {
if eventType == AuthenticationStatus && status == IframeLoggedOut {
handleLogout()->ignore
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/screens/Recon/ReconTypes.res
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
type authStatus = IframeLoggedIn | IframeLoggedOut

type eventType = AuthenticationStatus
7 changes: 7 additions & 0 deletions src/screens/Recon/ReconUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ let getAuthStatusFromMessage = authStatus =>
| "LoggedOut" => IframeLoggedOut
| _ => IframeLoggedIn
}

let getEventTypeFromString = eventTypeString =>
switch eventTypeString {
| "AuthenticationStatus"
| _ =>
AuthenticationStatus
}

0 comments on commit 51ccfdb

Please sign in to comment.