Skip to content

Commit

Permalink
♻️ (LekaApp): Navigation - add currentActivity property + refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Feb 21, 2024
1 parent 2c09758 commit 21d7dae
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions Apps/LekaApp/Sources/_NEWCodeBase/Navigation/Navigation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@
// Copyright APF France handicap
// SPDX-License-Identifier: Apache-2.0

import ContentKit
import SwiftUI

class Navigation: ObservableObject {
// MARK: Public
// MARK: Lifecycle

public var selectedCategory: Category? = .news {
private init() {
// nothing to do
}

// MARK: Internal

static let shared = Navigation()

@Published var disableUICompletly: Bool = false
@Published var categories = Category.allCases

@Published var currentActivity: Activity?

var selectedCategory: Category? = .news {
willSet {
self.disableUICompletly = true
// ? Note: early return to avoid reseting path
Expand All @@ -21,14 +35,6 @@ class Navigation: ObservableObject {
}
}

// MARK: Internal

static let shared = Navigation()

@Published var disableUICompletly: Bool = false

@Published var categories = Category.allCases

@Published var path: NavigationPath = .init() {
willSet {
self.disableUICompletly = true
Expand Down

0 comments on commit 21d7dae

Please sign in to comment.