mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-16 11:26:04 +00:00
chore(apps): remove dead code
This commit is contained in:
@@ -406,11 +406,3 @@ extension Request: Codable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Shared transport settings
|
||||
public let controlSocketPath: String = {
|
||||
let home = FileManager().homeDirectoryForCurrentUser
|
||||
return home
|
||||
.appendingPathComponent("Library/Application Support/OpenClaw/control.sock")
|
||||
.path
|
||||
}()
|
||||
|
||||
@@ -9,7 +9,6 @@ public struct OpenClawChatHaptics: Sendable {
|
||||
case messageSent
|
||||
case runCompleted
|
||||
case runFailed
|
||||
case actionConfirmed
|
||||
}
|
||||
|
||||
private let performer: @Sendable (Event) -> Void
|
||||
@@ -36,8 +35,6 @@ public struct OpenClawChatHaptics: Sendable {
|
||||
UINotificationFeedbackGenerator().notificationOccurred(.success)
|
||||
case .runFailed:
|
||||
UINotificationFeedbackGenerator().notificationOccurred(.error)
|
||||
case .actionConfirmed:
|
||||
UISelectionFeedbackGenerator().selectionChanged()
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -618,10 +618,6 @@ public final class OpenClawChatViewModel {
|
||||
return !trimmed.isEmpty || !self.attachments.isEmpty
|
||||
}
|
||||
|
||||
public var canSendDraft: Bool {
|
||||
!self.isSubmittingDraft && !self.isSending && self.hasDraftToSend
|
||||
}
|
||||
|
||||
/// True while replacing this model could move an attachment across chats.
|
||||
public var isAttachmentOwnerPinned: Bool {
|
||||
self.blocksAttachmentOwnerChange
|
||||
|
||||
@@ -8,21 +8,4 @@ public enum GatewayConnectChallengeSupport {
|
||||
guard !trimmed.isEmpty else { return nil }
|
||||
return trimmed
|
||||
}
|
||||
|
||||
public static func waitForNonce(
|
||||
timeoutSeconds: Double,
|
||||
onTimeout: @escaping @Sendable () -> some Error,
|
||||
receiveNonce: @escaping @Sendable () async throws -> String?) async throws -> String
|
||||
{
|
||||
try await AsyncTimeout.withTimeout(
|
||||
seconds: timeoutSeconds,
|
||||
onTimeout: onTimeout,
|
||||
operation: {
|
||||
while true {
|
||||
if let nonce = try await receiveNonce() {
|
||||
return nonce
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import Foundation
|
||||
|
||||
public enum LocalNetworkURLSupport {
|
||||
public static func isLocalNetworkHTTPURL(_ url: URL) -> Bool {
|
||||
guard let scheme = url.scheme?.lowercased(), scheme == "http" || scheme == "https" else {
|
||||
return false
|
||||
}
|
||||
guard let host = url.host?.trimmingCharacters(in: .whitespacesAndNewlines), !host.isEmpty else {
|
||||
return false
|
||||
}
|
||||
return LoopbackHost.isLocalNetworkHost(host)
|
||||
}
|
||||
}
|
||||
@@ -39,16 +39,6 @@ public func parseWizardDeviceCode(
|
||||
message: raw?["message"]?.value as? String)
|
||||
}
|
||||
|
||||
public func decodeWizardStep(_ raw: [String: AnyCodable]?) -> WizardStep? {
|
||||
guard let raw else { return nil }
|
||||
do {
|
||||
let data = try JSONEncoder().encode(raw)
|
||||
return try JSONDecoder().decode(WizardStep.self, from: data)
|
||||
} catch {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
public func parseWizardOptions(_ raw: [[String: AnyCodable]]?) -> [WizardOption] {
|
||||
guard let raw else { return [] }
|
||||
return raw.map { entry in
|
||||
|
||||
@@ -31,10 +31,6 @@ public struct Logger: Sendable {
|
||||
print("[\(level.rawValue.uppercased())] \(ts) | \(message)")
|
||||
}
|
||||
|
||||
public func trace(_ msg: String) {
|
||||
self.log(.trace, msg)
|
||||
}
|
||||
|
||||
public func debug(_ msg: String) {
|
||||
self.log(.debug, msg)
|
||||
}
|
||||
@@ -43,10 +39,6 @@ public struct Logger: Sendable {
|
||||
self.log(.info, msg)
|
||||
}
|
||||
|
||||
public func warn(_ msg: String) {
|
||||
self.log(.warn, msg)
|
||||
}
|
||||
|
||||
public func error(_ msg: String) {
|
||||
self.log(.error, msg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user