diff --git a/docker-compose.yml b/docker-compose.yml index 862b517..58d9773 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,8 @@ services: condition: service_healthy volumes: - ./:/app - command: npm run dev + - api-node_modules:/app/node_modules + command: sh -c "npm install && npm run dev" redis: image: redis:7-alpine @@ -63,3 +64,4 @@ services: volumes: postgres-data: frontend-node_modules: + api-node_modules: diff --git a/ios/Bookibra.xcodeproj/project.xcworkspace/xcuserdata/wisecolt-macbook.xcuserdatad/UserInterfaceState.xcuserstate b/ios/Bookibra.xcodeproj/project.xcworkspace/xcuserdata/wisecolt-macbook.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..b042412 Binary files /dev/null and b/ios/Bookibra.xcodeproj/project.xcworkspace/xcuserdata/wisecolt-macbook.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ios/Bookibra.xcodeproj/xcuserdata/wisecolt-macbook.xcuserdatad/xcschemes/xcschememanagement.plist b/ios/Bookibra.xcodeproj/xcuserdata/wisecolt-macbook.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..0437220 --- /dev/null +++ b/ios/Bookibra.xcodeproj/xcuserdata/wisecolt-macbook.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Bookibra.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/ios/Bookibra/DesignSystem/Components/NetworkErrorView.swift b/ios/Bookibra/DesignSystem/Components/NetworkErrorView.swift index b496cbb..af0b7b0 100644 --- a/ios/Bookibra/DesignSystem/Components/NetworkErrorView.swift +++ b/ios/Bookibra/DesignSystem/Components/NetworkErrorView.swift @@ -6,8 +6,6 @@ struct NetworkErrorView: View { var body: some View { VStack(spacing: 12) { - Image(systemName: "wifi.exclamationmark") - .font(.title2) Text(message) .font(.subheadline) .multilineTextAlignment(.center) diff --git a/ios/Bookibra/Resources/Debug.xcconfig b/ios/Bookibra/Resources/Debug.xcconfig index d8e5cff..734797c 100644 --- a/ios/Bookibra/Resources/Debug.xcconfig +++ b/ios/Bookibra/Resources/Debug.xcconfig @@ -1 +1 @@ -API_BASE_URL = http://192.168.1.124:8080 +API_BASE_URL = http://192.168.1.141:8080 diff --git a/ios/Bookibra/Resources/Info.plist b/ios/Bookibra/Resources/Info.plist index b75bd79..b6ec619 100644 --- a/ios/Bookibra/Resources/Info.plist +++ b/ios/Bookibra/Resources/Info.plist @@ -39,7 +39,7 @@ API_BASE_URL - http://192.168.1.124:8080 + http://192.168.1.141:8080 NSCameraUsageDescription ISBN barkodu taramak için kameraya erişim gerekiyor. diff --git a/ios/Bookibra/Resources/Release.xcconfig b/ios/Bookibra/Resources/Release.xcconfig index 3dbde3d..734797c 100644 --- a/ios/Bookibra/Resources/Release.xcconfig +++ b/ios/Bookibra/Resources/Release.xcconfig @@ -1 +1 @@ -API_BASE_URL = http://localhost:8080 +API_BASE_URL = http://192.168.1.141:8080 diff --git a/ios/Bookibra/Services/APIClient.swift b/ios/Bookibra/Services/APIClient.swift index 2836f55..708356b 100644 --- a/ios/Bookibra/Services/APIClient.swift +++ b/ios/Bookibra/Services/APIClient.swift @@ -108,7 +108,7 @@ extension Bundle { return url } - // 2) If scheme is missing (e.g. "192.168.1.124:8080"), prepend http://. + // 2) If scheme is missing (e.g. "192.168.1.141:8080"), prepend http://. if !raw.isEmpty, !raw.contains("://"), let url = URL(string: "http://\(raw)"), let host = url.host, !host.isEmpty { @@ -116,7 +116,7 @@ extension Bundle { } // 3) Device-local fallback for current dev network. - if let fallback = URL(string: "http://192.168.1.124:8080") { + if let fallback = URL(string: "http://192.168.1.141:8080") { #if DEBUG print("[API] Invalid API_BASE_URL='\(raw)'. Falling back to \(fallback.absoluteString)") #endif diff --git a/ios/Bookibra/ViewModels/AddBooksViewModel.swift b/ios/Bookibra/ViewModels/AddBooksViewModel.swift index 45b668c..56d1673 100644 --- a/ios/Bookibra/ViewModels/AddBooksViewModel.swift +++ b/ios/Bookibra/ViewModels/AddBooksViewModel.swift @@ -56,6 +56,7 @@ final class AddBooksViewModel: ObservableObject { results = try await booksService.searchByTitle(value, locales: "tr,en") errorMessage = nil } catch { + guard !isIgnorable(error) else { return } errorMessage = error.localizedDescription } } @@ -69,6 +70,7 @@ final class AddBooksViewModel: ObservableObject { results = try await booksService.searchByISBN(isbn, locales: "tr,en") errorMessage = nil } catch { + guard !isIgnorable(error) else { return } errorMessage = error.localizedDescription } } @@ -82,7 +84,22 @@ final class AddBooksViewModel: ObservableObject { results = try await booksService.filter(title: filterTitle, year: filterYear, locales: "tr,en") errorMessage = nil } catch { + guard !isIgnorable(error) else { return } errorMessage = error.localizedDescription } } + + private func isIgnorable(_ error: Error) -> Bool { + if error is CancellationError { + return true + } + + let nsError = error as NSError + if nsError.domain == NSURLErrorDomain, nsError.code == NSURLErrorCancelled { + return true + } + + let message = error.localizedDescription.lowercased() + return message.contains("cancelled") || message.contains("vazgeç") + } }