ReadKeep/readeck/Domain/UseCase/SaveSettingsUseCase.swift
Ilyas Hallak 5b2d177f94 feat: Enhanced tag management with unified search and keyboard handling
- Added search functionality to BookmarkLabelsView with real-time filtering
- Implemented custom tag creation with smart suggestions
- Unified search and tag selection in ShareBookmarkView
- Added keyboard toolbar with 'Done' button for extensions
- Implemented notification-based keyboard dismissal for extensions
- Added pagination logic to ShareBookmarkViewModel
- Created selected tags section with remove functionality
- Improved UX with consistent tag management across views
- Added proper keyboard handling for iOS extensions
2025-07-30 23:53:30 +02:00

69 lines
2.1 KiB
Swift

import Foundation
protocol PSaveSettingsUseCase {
func execute(endpoint: String, username: String, password: String) async throws
func execute(endpoint: String, username: String, password: String, hasFinishedSetup: Bool) async throws
func execute(token: String) async throws
func execute(selectedFontFamily: FontFamily, selectedFontSize: FontSize) async throws
func execute(enableTTS: Bool) async throws
func execute(theme: Theme) async throws
}
class SaveSettingsUseCase: PSaveSettingsUseCase {
private let settingsRepository: PSettingsRepository
init(settingsRepository: PSettingsRepository) {
self.settingsRepository = settingsRepository
}
func execute(endpoint: String, username: String, password: String) async throws {
try await settingsRepository.saveSettings(
.init(
endpoint: endpoint,
username: username,
password: password
)
)
}
func execute(endpoint: String, username: String, password: String, hasFinishedSetup: Bool) async throws {
try await settingsRepository.saveSettings(
.init(
endpoint: endpoint,
username: username,
password: password,
hasFinishedSetup: hasFinishedSetup
)
)
}
func execute(token: String) async throws {
try await settingsRepository.saveSettings(
.init(
token: token
)
)
}
func execute(selectedFontFamily: FontFamily, selectedFontSize: FontSize) async throws {
try await settingsRepository.saveSettings(
.init(
fontFamily: selectedFontFamily,
fontSize: selectedFontSize
)
)
}
func execute(enableTTS: Bool) async throws {
try await settingsRepository.saveSettings(
.init(enableTTS: enableTTS)
)
}
func execute(theme: Theme) async throws {
try await settingsRepository.saveSettings(
.init(theme: theme)
)
}
}