Skip to content

Commit

Permalink
Merge branch 'release/1.3.2' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mouredev committed Feb 17, 2022
2 parents 9a43159 + e6463ae commit acda28a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 21 deletions.
8 changes: 4 additions & 4 deletions Twitimer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Twitimer/Twitimer.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"Twitimer/Preview Content\"";
DEVELOPMENT_TEAM = SJGR47U9J5;
ENABLE_PREVIEWS = YES;
Expand All @@ -1128,7 +1128,7 @@
"@executable_path/Frameworks",
);
MACH_O_TYPE = mh_execute;
MARKETING_VERSION = 1.3;
MARKETING_VERSION = 1.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.mouredev.Twitimer;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -1143,7 +1143,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Twitimer/Twitimer.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"Twitimer/Preview Content\"";
DEVELOPMENT_TEAM = SJGR47U9J5;
ENABLE_PREVIEWS = YES;
Expand All @@ -1154,7 +1154,7 @@
"@executable_path/Frameworks",
);
MACH_O_TYPE = mh_execute;
MARKETING_VERSION = 1.3;
MARKETING_VERSION = 1.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.mouredev.Twitimer;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
2 changes: 1 addition & 1 deletion Twitimer/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
UITabBar.appearance().isTranslucent = false
UITabBar.appearance().clipsToBounds = true // Remove top line
UITabBar.appearance().standardAppearance = tabBarAppearance
if #available(iOS 15.0, *) {
if #available(iOS 15, *) {
UITabBar.appearance().scrollEdgeAppearance = tabBarAppearance
}

Expand Down
2 changes: 1 addition & 1 deletion Twitimer/UseCases/Countdown/CountdownView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ struct CountdownView: View {
TimerRowView(streaming: streaming, endDate:
streaming.schedule.date)
}
.hideTableSeparator()
.background(Color.backgroundColor)
.hideTableSeparator()
}
}.listStyle(.plain)
.pullToRefresh(isShowing: $isShowingRefresh) {
Expand Down
2 changes: 1 addition & 1 deletion Twitimer/UseCases/Home/HomeViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ final class HomeViewModel: ObservableObject {
return router.menuView()
}

func tabView(type: HomeViewTabType, delegate: CountdownViewModelDelegate? = nil) -> AnyView {
func tabView(type: HomeViewTabType, delegate: CountdownViewModelDelegate? = nil) -> some View {

switch type {
case .countdown:
Expand Down
16 changes: 10 additions & 6 deletions Twitimer/UseCases/Launch/Account/User/UserViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class UserViewModel: ObservableObject {

var isStreamer: Bool {
get {
return user?.streamer ?? Session.shared.user?.streamer ?? false
return getUser()?.streamer ?? false
}
}

Expand All @@ -46,15 +46,15 @@ final class UserViewModel: ObservableObject {
self.user = user
self.onClose = onClose
self.readOnly = user != nil
self.schedule = filterSchedule(schedules: user?.schedule ?? Session.shared.user?.schedule ?? [])
self.onHolidays = user?.settings?.onHolidays ?? Session.shared.user?.settings?.onHolidays ?? false

self.onHolidays = getUser()?.settings?.onHolidays ?? false
self.schedule = filterSchedule(schedules: getUser()?.schedule ?? [])
}

// Public

func userView(isStreamer: Bool) -> UserHeaderView? {
if let user = user ?? Session.shared.user {
if let user = getUser() {
if user.login != nil {
return router.userHeaderView(user: user, readOnly: readOnly, isStreamer: isStreamer, onClose: onClose, updateHolidays: {
self.onHolidays = Session.shared.user?.settings?.onHolidays ?? false
Expand All @@ -77,7 +77,7 @@ final class UserViewModel: ObservableObject {
}

func hasUser() -> Bool {
return (user ?? Session.shared.user) != nil
return getUser() != nil
}

func save(streamer: Bool) {
Expand Down Expand Up @@ -113,6 +113,10 @@ final class UserViewModel: ObservableObject {

// Private

private func getUser() -> User? {
return user ?? Session.shared.user
}

private func filterSchedule(schedules: [UserSchedule]) -> [UserSchedule] {
return schedules.filter { schedule in
// Si estamos en modo lectura no se muestran los no habilitados o eventos puntuales pasados
Expand Down
5 changes: 2 additions & 3 deletions Twitimer/UseCases/Search/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,12 @@ struct SearchView: View {
if let search = viewModel.search, !search.isEmpty {
ForEach(search, id: \.id) { user in
SearchRowView(user: nil, userSearch: user, addAction: nil)
.hideTableSeparator()
.background(Color.backgroundColor)
.onTapGesture {
if let user = user.broadcasterLogin {
viewModel.search(user: user)
}
}
}.hideTableSeparator()
}
} else {
ForEach(viewModel.users, id: \.id) { user in
Expand All @@ -102,8 +101,8 @@ struct SearchView: View {
viewModel.updateCount()
})
}
.hideTableSeparator()
.background(Color.backgroundColor)
.hideTableSeparator()
}
}
}.listStyle(.plain)
Expand Down
11 changes: 6 additions & 5 deletions Twitimer/Util/Extension/ViewExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ extension View {
if condition { transform(self) }
else { self }
}

// MARK: iOS 15

func hideTableSeparator() -> AnyView {
if #available(iOS 15.0, *) {
return AnyView(self.listRowSeparator(.hidden).listRowInsets(EdgeInsets()))
func hideTableSeparator() -> some View {
if #available(iOS 15, *) {
return AnyView(listRowSeparator(.hidden).listRowInsets(EdgeInsets()))
} else {
return AnyView(listRowInsets(EdgeInsets()))
}
return AnyView(self.listRowInsets(EdgeInsets()))
}

}
Expand Down

0 comments on commit acda28a

Please sign in to comment.