Skip to content

Commit

Permalink
Fixes compilation error on watchOS
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeichhorn committed Jun 23, 2024
1 parent f47f2c2 commit a04805d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/YouTubeKit/Cipher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
//

import Foundation
#if canImport(JavaScriptCore)
import JavaScriptCore
#endif
import os.log

@available(iOS 13.0, watchOS 6.0, tvOS 13.0, macOS 10.15, *)
Expand Down Expand Up @@ -52,6 +54,7 @@ class Cipher {
return newN
}

#if canImport(JavaScriptCore)
guard let context = JSContext() else {
os_log("failed to create JSContext", log: Cipher.log, type: .error)
return ""
Expand All @@ -71,6 +74,9 @@ class Cipher {
calculatedN[initialN] = newN

return newN
#else
return ""
#endif
}

/// Decipher the signature
Expand Down

0 comments on commit a04805d

Please sign in to comment.