Skip to content

Commit 220e8ee

Browse files
committed
fix: windows private fields
1 parent ddbff67 commit 220e8ee

File tree

1 file changed

+15
-15
lines changed
  • src/Packages/Passport/Runtime/Scripts/Public

1 file changed

+15
-15
lines changed

src/Packages/Passport/Runtime/Scripts/Public/Passport.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class Passport
3737
private PassportImpl? _passportImpl;
3838
public string Environment { get; private set; }
3939

40-
private IWebBrowserClient _webBrowserClient;
40+
private IWebBrowserClient? _webBrowserClient;
4141

4242
// Keeps track of the latest received deeplink
4343
private static string? _deeplink;
@@ -140,15 +140,15 @@ private Passport()
140140
/// <param name="redirectUri">The URL where the browser will redirect after successful authentication.</param>
141141
/// <param name="logoutRedirectUri">The URL where the browser will redirect after logout is complete.</param>
142142
/// <param name="engineStartupTimeoutMs">(Windows only) Timeout duration in milliseconds to wait for the default Windows browser engine to start.</param>
143-
/// <param name="webBrowserClient">(Windows only) Custom Windows browser to use instead of the default browser in the SDK.</param>
143+
/// <param name="windowsWebBrowserClient">(Windows only) Custom Windows browser to use instead of the default browser in the SDK.</param>
144144
public static UniTask<Passport> Init(
145145
string clientId,
146146
string environment,
147147
string redirectUri,
148148
string logoutRedirectUri
149149
#if UNITY_STANDALONE_WIN || (UNITY_ANDROID && UNITY_EDITOR_WIN) || (UNITY_IPHONE && UNITY_EDITOR_WIN)
150150
, int engineStartupTimeoutMs = 60000,
151-
IWindowsWebBrowserClient windowsWebBrowserClient = null
151+
IWindowsWebBrowserClient? windowsWebBrowserClient = null
152152
#endif
153153
)
154154
{
@@ -202,10 +202,10 @@ string logoutRedirectUri
202202
/// Initialises the appropriate web browser and sets up browser communication.
203203
/// </summary>
204204
/// <param name="engineStartupTimeoutMs">(Windows only) Timeout duration in milliseconds to wait for the default Windows browser engine to start.</param>
205-
/// <param name="webBrowserClient">(Windows only) Custom Windows browser to use instead of the default browser in the SDK.</param>
205+
/// <param name="windowsWebBrowserClient">(Windows only) Custom Windows browser to use instead of the default browser in the SDK.</param>
206206
private async UniTask Initialise(
207207
#if UNITY_STANDALONE_WIN || (UNITY_ANDROID && UNITY_EDITOR_WIN) || (UNITY_IPHONE && UNITY_EDITOR_WIN)
208-
int engineStartupTimeoutMs, IWindowsWebBrowserClient windowsWebBrowserClient
208+
int engineStartupTimeoutMs, IWindowsWebBrowserClient? windowsWebBrowserClient
209209
#endif
210210
)
211211
{
@@ -216,18 +216,18 @@ private async UniTask Initialise(
216216
if (windowsWebBrowserClient != null)
217217
{
218218
// Use the provided custom Windows browser client
219-
this.webBrowserClient = new WindowsWebBrowserClientAdapter(windowsWebBrowserClient);
220-
await ((WindowsWebBrowserClientAdapter)this.webBrowserClient).Init();
219+
_webBrowserClient = new WindowsWebBrowserClientAdapter(windowsWebBrowserClient);
220+
await ((WindowsWebBrowserClientAdapter)_webBrowserClient).Init();
221221
}
222222
else
223223
{
224224
#if IMMUTABLE_CUSTOM_BROWSER
225225
throw new PassportException("When 'IMMUTABLE_CUSTOM_BROWSER' is defined in Scripting Define Symbols, " +
226226
" 'windowsWebBrowserClient' must not be null.");
227227
#else
228-
webBrowserClient = gameObject.AddComponent<UwbWebView>();
229-
await ((UwbWebView)webBrowserClient).Init(engineStartupTimeoutMs, _redactTokensInLogs, RedactTokenValues);
230-
readySignalReceived = true;
228+
_webBrowserClient = gameObject.AddComponent<UwbWebView>();
229+
await ((UwbWebView)_webBrowserClient).Init(engineStartupTimeoutMs, _redactTokensInLogs, RedactTokenValues);
230+
_readySignalReceived = true;
231231
#endif
232232
}
233233
#elif (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX || UNITY_WEBGL
@@ -543,7 +543,7 @@ public void ClearStorage()
543543
/// </summary>
544544
private static void SetDefaultWindowsBrowserLogLevel()
545545
{
546-
if (Instance?.webBrowserClient is WebBrowserClient browserClient)
546+
if (Instance?._webBrowserClient is WebBrowserClient browserClient)
547547
{
548548
browserClient.logSeverity = _logLevel switch
549549
{
@@ -557,7 +557,7 @@ private static void SetDefaultWindowsBrowserLogLevel()
557557

558558
private static void SetWindowsRedactionHandler()
559559
{
560-
if (Instance?.webBrowserClient is WebBrowserClient browserClient)
560+
if (Instance?._webBrowserClient is WebBrowserClient browserClient)
561561
{
562562
browserClient.Logger = new DefaultUnityWebBrowserLogger(redactionHandler: _redactTokensInLogs ? RedactTokenValues : null);
563563
}
@@ -651,10 +651,10 @@ private void DisposeAll()
651651
{
652652
// Dispose of the web browser client for Windows only
653653
#if UNITY_STANDALONE_WIN || (UNITY_ANDROID && UNITY_EDITOR_WIN) || (UNITY_IPHONE && UNITY_EDITOR_WIN)
654-
if (webBrowserClient != null)
654+
if (_webBrowserClient != null)
655655
{
656-
webBrowserClient.Dispose();
657-
webBrowserClient = null;
656+
_webBrowserClient.Dispose();
657+
_webBrowserClient = null;
658658
}
659659
#endif
660660

0 commit comments

Comments
 (0)