mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Add a Compound hook. (#3979)
* Rename AppHooksProtocol.configure() to .setUp(). * Add a CompoundHook.
This commit is contained in:
@@ -14,6 +14,11 @@ class AppHooks: AppHooksProtocol {
|
||||
appSettingsHook = hook
|
||||
}
|
||||
|
||||
private(set) var compoundHook: CompoundHookProtocol = DefaultCompoundHook()
|
||||
func registerCompoundHook(_ hook: CompoundHookProtocol) {
|
||||
compoundHook = hook
|
||||
}
|
||||
|
||||
private(set) var bugReportHook: BugReportHookProtocol = DefaultBugReportHook()
|
||||
func registerBugReportHook(_ hook: BugReportHookProtocol) {
|
||||
bugReportHook = hook
|
||||
@@ -32,9 +37,9 @@ class AppHooks: AppHooksProtocol {
|
||||
}
|
||||
|
||||
protocol AppHooksProtocol {
|
||||
func configure()
|
||||
func setUp()
|
||||
}
|
||||
|
||||
extension AppHooksProtocol {
|
||||
func configure() { }
|
||||
func setUp() { }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Copyright 2025 New Vector Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Compound
|
||||
|
||||
protocol CompoundHookProtocol {
|
||||
func override(colors: CompoundColors, uiColors: CompoundUIColors)
|
||||
}
|
||||
|
||||
struct DefaultCompoundHook: CompoundHookProtocol {
|
||||
func override(colors: CompoundColors, uiColors: CompoundUIColors) { }
|
||||
}
|
||||
Reference in New Issue
Block a user