mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
Disable meetings view when audio/video conference factory address is missing
This commit is contained in:
parent
e81699052a
commit
5837e5e85d
3 changed files with 68 additions and 49 deletions
|
|
@ -346,32 +346,34 @@ struct ContentView: View {
|
|||
}
|
||||
.frame(height: geometry.size.height/4)
|
||||
}
|
||||
|
||||
Button(action: {
|
||||
sharedMainViewModel.changeIndexView(indexViewInt: 3)
|
||||
sharedMainViewModel.displayedFriend = nil
|
||||
sharedMainViewModel.displayedCall = nil
|
||||
sharedMainViewModel.displayedConversation = nil
|
||||
}, label: {
|
||||
VStack {
|
||||
Image("video-conference")
|
||||
.renderingMode(.template)
|
||||
.resizable()
|
||||
.foregroundStyle(sharedMainViewModel.indexView == 3 ? Color.orangeMain500 : Color.grayMain2c600)
|
||||
.frame(width: 25, height: 25)
|
||||
if sharedMainViewModel.indexView == 0 {
|
||||
Text("bottom_navigation_meetings_label")
|
||||
.default_text_style_700(styleSize: 10)
|
||||
} else {
|
||||
Text("bottom_navigation_meetings_label")
|
||||
.default_text_style(styleSize: 10)
|
||||
}
|
||||
}
|
||||
})
|
||||
.padding(.top)
|
||||
.frame(height: geometry.size.height/4)
|
||||
|
||||
Spacer()
|
||||
if !sharedMainViewModel.disableMeetingFeature {
|
||||
Button(action: {
|
||||
sharedMainViewModel.changeIndexView(indexViewInt: 3)
|
||||
sharedMainViewModel.displayedFriend = nil
|
||||
sharedMainViewModel.displayedCall = nil
|
||||
sharedMainViewModel.displayedConversation = nil
|
||||
}, label: {
|
||||
VStack {
|
||||
Image("video-conference")
|
||||
.renderingMode(.template)
|
||||
.resizable()
|
||||
.foregroundStyle(sharedMainViewModel.indexView == 3 ? Color.orangeMain500 : Color.grayMain2c600)
|
||||
.frame(width: 25, height: 25)
|
||||
if sharedMainViewModel.indexView == 0 {
|
||||
Text("bottom_navigation_meetings_label")
|
||||
.default_text_style_700(styleSize: 10)
|
||||
} else {
|
||||
Text("bottom_navigation_meetings_label")
|
||||
.default_text_style(styleSize: 10)
|
||||
}
|
||||
}
|
||||
})
|
||||
.padding(.top)
|
||||
.frame(height: geometry.size.height/4)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(width: 75, height: geometry.size.height)
|
||||
|
|
@ -906,31 +908,33 @@ struct ContentView: View {
|
|||
.frame(width: 66)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer()
|
||||
Button(action: {
|
||||
sharedMainViewModel.changeIndexView(indexViewInt: 3)
|
||||
sharedMainViewModel.displayedFriend = nil
|
||||
sharedMainViewModel.displayedCall = nil
|
||||
sharedMainViewModel.displayedConversation = nil
|
||||
}, label: {
|
||||
VStack {
|
||||
Image("video-conference")
|
||||
.renderingMode(.template)
|
||||
.resizable()
|
||||
.foregroundStyle(sharedMainViewModel.indexView == 3 ? Color.orangeMain500 : Color.grayMain2c600)
|
||||
.frame(width: 25, height: 25)
|
||||
if sharedMainViewModel.indexView == 3 {
|
||||
Text("bottom_navigation_meetings_label")
|
||||
.default_text_style_700(styleSize: 9)
|
||||
} else {
|
||||
Text("bottom_navigation_meetings_label")
|
||||
.default_text_style(styleSize: 9)
|
||||
|
||||
if !sharedMainViewModel.disableMeetingFeature {
|
||||
Spacer()
|
||||
Button(action: {
|
||||
sharedMainViewModel.changeIndexView(indexViewInt: 3)
|
||||
sharedMainViewModel.displayedFriend = nil
|
||||
sharedMainViewModel.displayedCall = nil
|
||||
sharedMainViewModel.displayedConversation = nil
|
||||
}, label: {
|
||||
VStack {
|
||||
Image("video-conference")
|
||||
.renderingMode(.template)
|
||||
.resizable()
|
||||
.foregroundStyle(sharedMainViewModel.indexView == 3 ? Color.orangeMain500 : Color.grayMain2c600)
|
||||
.frame(width: 25, height: 25)
|
||||
if sharedMainViewModel.indexView == 3 {
|
||||
Text("bottom_navigation_meetings_label")
|
||||
.default_text_style_700(styleSize: 9)
|
||||
} else {
|
||||
Text("bottom_navigation_meetings_label")
|
||||
.default_text_style(styleSize: 9)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.padding(.top)
|
||||
.frame(width: 66)
|
||||
})
|
||||
.padding(.top)
|
||||
.frame(width: 66)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,6 +215,9 @@ class AccountSettingsViewModel: ObservableObject {
|
|||
newParams.limeServerUrl = self.limeServerUrl
|
||||
|
||||
self.accountModel.account.params = newParams
|
||||
|
||||
SharedMainViewModel.shared.updateDisableMeetingFeature()
|
||||
|
||||
print("\(AccountSettingsViewModel.TAG) Changes have been saved")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ class SharedMainViewModel: ObservableObject {
|
|||
@Published var missedCallsCount: Int = 0
|
||||
|
||||
@Published var disableChatFeature: Bool = false
|
||||
@Published var disableMeetingFeature: Bool = false
|
||||
|
||||
let welcomeViewKey = "welcome_view"
|
||||
let generalTermsKey = "general_terms"
|
||||
|
|
@ -94,6 +95,7 @@ class SharedMainViewModel: ObservableObject {
|
|||
updateMissedCallsCount()
|
||||
updateUnreadMessagesCount()
|
||||
updateDisableChatFeature()
|
||||
updateDisableMeetingFeature()
|
||||
}
|
||||
|
||||
func changeWelcomeView() {
|
||||
|
|
@ -224,4 +226,14 @@ class SharedMainViewModel: ObservableObject {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func updateDisableMeetingFeature() {
|
||||
CoreContext.shared.doOnCoreQueue { core in
|
||||
let disableMeetingFeatureTmp = CorePreferences.disableMeetings ||
|
||||
!LinphoneUtils.isRemoteConferencingAvailable(core: core)
|
||||
DispatchQueue.main.async {
|
||||
self.disableMeetingFeature = disableMeetingFeatureTmp
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue