Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structural improvements - 1 #64

Merged
merged 9 commits into from
Jun 15, 2021
Merged

Conversation

PangMo5
Copy link
Member

@PangMo5 PangMo5 commented Jun 13, 2021

Changed

Replace GlobalData with ServerEnvironment and SessionManager

ServerEnvironment.current.server.*
ServerEnvironment.current.setUp(with uri: String) -> AnyPublisher<Server, Error>
ServerEnvironment.current.reset() throws

SessionManager.current.user.*
SessionManager.current.login(username: String, password: String) -> AnyPublisher<SignedInUser, Error>
SessionManager.current.logout() throws

Replace OrientationInfo with DeviceRotationViewModifier

struct ContentView: View {
    @State private var orientation = UIDeviceOrientation.unknown

    var body: some View {
        Group {
            if orientation.isPortrait {
                Text("Portrait")
            } else if orientation.isLandscape {
                Text("Landscape")
            } else if orientation.isFlat {
                Text("Flat")
            } else {
                Text("Unknown")
            }
        }
        .onRotate { newOrientation in
            orientation = newOrientation
        }
    }
}

First of all, initial screens (ContentView and ConnectToServerView) Refactoring

  • remove ContentView
  • refactor ConnectToServerView
  • refactor LibraryListView
  • add HomeView
  • add MainTabView
  • add SplashView
  • add ConnectToServerViewModel
  • add HomeViewModel
  • add LibraryListViewModel
  • add SplashViewModel
  • add ViewModel

The logic may be different from the previous logic due to lack of understanding of the logic in the login part.
Please check :D

#55

add SessionManager
remove WidgetEnvironment
add SessionManager.updateHeader, login, logout
acvigue
acvigue previously approved these changes Jun 14, 2021
remove ContentView
add HomeView
add MainTabView
add SplashView
add ConnectToServerViewModel
add HomeViewModel
add LibraryListViewModel
add SplashViewModel
add ViewModel
@PangMo5 PangMo5 changed the title [WIP] Structural improvements Structural improvements #1 Jun 15, 2021
@PangMo5 PangMo5 marked this pull request as ready for review June 15, 2021 13:50
@PangMo5 PangMo5 changed the title Structural improvements #1 Structural improvements - 1 Jun 15, 2021
@PangMo5
Copy link
Member Author

PangMo5 commented Jun 15, 2021

Refactoring of the initial screens is over, and I will work on the other screens when I have time.

@PangMo5 PangMo5 requested a review from acvigue June 15, 2021 13:57
@acvigue acvigue merged commit 3b0429d into jellyfin:main Jun 15, 2021
@PangMo5 PangMo5 deleted the PangMo5/refactoring branch July 23, 2021 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants