Skip to content

Commit

Permalink
fix(Home): fixed icon positioning and formatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasfroeller committed Jun 13, 2024
1 parent d04003e commit cae5981
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
3 changes: 1 addition & 2 deletions core/features/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import Foundation
import SwiftUI

class AppDelegate: NSObject, UIApplicationDelegate {

static var orientationLock = UIInterfaceOrientationMask.all

func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
func application(_: UIApplication, supportedInterfaceOrientationsFor _: UIWindow?) -> UIInterfaceOrientationMask {
return AppDelegate.orientationLock
}
}
8 changes: 4 additions & 4 deletions core/features/Chat/ViewModel/ChatViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class ChatViewModel: ObservableObject {
if Environment.isDebug { print("updating chat messages...") }
self.updateChatWithNewMessage(message, monitor_hash: monitorId)
}
UNUserNotificationCenter.current().requestAuthorization(options: [.alert,.sound]) { granted, error in

UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound]) { granted, error in
if let error = error {
print("Error requesting notification permission: \(error.localizedDescription)")
} else if granted {
Expand Down Expand Up @@ -82,7 +82,7 @@ class ChatViewModel: ObservableObject {
updatedChats[chatIndex] = updatedChat

chatsModel.setChats(chats: updatedChats)

if message.email != email {
let content = UNMutableNotificationContent()
content.title = "New Message from \(String(describing: message.email)) in \(String(describing: updatedChat.title))"
Expand All @@ -98,7 +98,7 @@ class ChatViewModel: ObservableObject {
}
}
}

// if (Environment.isDebug) { print("chat messages updated") }
// if (Environment.isDebug) { print("chat count", chatsModel.chats.endIndex) }
}
Expand Down
6 changes: 3 additions & 3 deletions core/features/Home/Views/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ struct HomeView: View {
.font(.caption)
.foregroundStyle(Color.gray)
.textCase(.uppercase)

HStack {
Spacer()
WebView(svgString: SVGIcons.github(size: 150))
.frame(width: 150)
.padding(.leading, 100)
.padding(.leading, 105)
Spacer()
}.padding(.bottom, 40)

HStack {
TextField("Monitor-ID", text: Binding(get: {
joinMonitorViewModel.monitorHash
Expand Down
12 changes: 6 additions & 6 deletions core/features/propromoApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ struct propromoApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.onAppear {
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
AppDelegate.orientationLock = .portrait
}
//.onDisappear {
.onAppear {
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
AppDelegate.orientationLock = .portrait
}
// .onDisappear {
// AppDelegate.orientationLock = .all
//}
// }
}
}
}
2 changes: 1 addition & 1 deletion core/services/ChatService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ChatService {
updatedAt: updated_at ?? Date(),
projectUrl: chat.project_url ?? ""
)

completion(.success([]))
}
webSocketManager.onError = { error in
Expand Down

0 comments on commit cae5981

Please sign in to comment.