Skip to content

Commit

Permalink
fix: concurrent mutation errors during react native build
Browse files Browse the repository at this point in the history
  • Loading branch information
mhamann committed Sep 19, 2022
1 parent 646293d commit dd5b900
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<key>RowndFrameworkTestApp.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>0</integer>
</dict>
<key>RowndSDK.xcscheme_^#shared#^_</key>
<dict>
Expand Down
5 changes: 3 additions & 2 deletions Sources/Rownd/Views/HubViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ public class HubViewController: UIViewController, HubViewProtocol {
// This ensures that the Hub in the webview doesn't attempt to refresh its own tokens,
// which might trigger an undesired sign-out now or in the future
if store.state.auth.isAuthenticated {
Task {
Task { [hubLoaderUrl] in
var hubLoaderUrl = hubLoaderUrl // Capture local copy of var to prevent compiler mutation issues
await Rownd.getAccessToken()
let rphInit = store.state.auth.toRphInitHash()
if let rphInit = rphInit {
hubLoaderUrl?.fragment = "rph_init=\(rphInit)"
}

DispatchQueue.main.async { [weak self] in
DispatchQueue.main.async { [weak self, hubLoaderUrl] in
guard let self = self else { return }
self.hubWebController.setUrl(url: (hubLoaderUrl?.url)!)
}
Expand Down

0 comments on commit dd5b900

Please sign in to comment.