master merged
This commit is contained in:
@@ -62,6 +62,16 @@ struct FeatureFlagsState: Codable, Equatable {
|
||||
var source: String = "default"
|
||||
var values: [String: FeatureFlagValue] = [:]
|
||||
var raw: [String: FeatureControlRawFlag] = [:]
|
||||
|
||||
func isEnabled(_ key: String, default defaultValue: Bool = false) -> Bool {
|
||||
if let rawValue = raw[key] {
|
||||
return rawValue.enabled || rawValue.variant.lowercased() == "on"
|
||||
}
|
||||
if let mapped = values[key] {
|
||||
return mapped.boolValue
|
||||
}
|
||||
return defaultValue
|
||||
}
|
||||
}
|
||||
|
||||
enum AppModal: String, Identifiable {
|
||||
|
||||
@@ -1,26 +1,10 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
#if os(Android)
|
||||
@MainActor
|
||||
final class SnackbarCenter {
|
||||
static let shared = SnackbarCenter()
|
||||
var current: SnackbarMessage?
|
||||
|
||||
func show(
|
||||
title: String,
|
||||
style: SnackbarStyle = .info,
|
||||
icon: String? = nil,
|
||||
duration: TimeInterval = 3.5,
|
||||
action: (() -> Void)? = nil
|
||||
) {
|
||||
action?()
|
||||
}
|
||||
|
||||
func handleTap() {}
|
||||
func dismiss(animated: Bool) {}
|
||||
extension Notification.Name {
|
||||
static let snackbarDidChange = Notification.Name("snackbarDidChange")
|
||||
}
|
||||
#else
|
||||
|
||||
@MainActor
|
||||
final class SnackbarCenter: ObservableObject {
|
||||
static let shared = SnackbarCenter()
|
||||
@@ -71,7 +55,6 @@ final class SnackbarCenter: ObservableObject {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
enum SnackbarStyle: Sendable {
|
||||
case info
|
||||
|
||||
Reference in New Issue
Block a user