|
@@ -16,17 +16,31 @@
|
16
|
16
|
*/
|
17
|
17
|
|
18
|
18
|
import WatchKit
|
|
19
|
+import WatchConnectivity
|
19
|
20
|
import Foundation
|
20
|
21
|
|
21
|
22
|
|
22
|
23
|
class InterfaceController: WKInterfaceController {
|
23
|
24
|
|
|
25
|
+ @IBOutlet var infoLabel: WKInterfaceLabel!
|
24
|
26
|
@IBOutlet var table: WKInterfaceTable!
|
25
|
27
|
|
|
28
|
+ override func didAppear(){
|
|
29
|
+ self.updateUI(ExtensionDelegate.currentJitsiMeetContext)
|
|
30
|
+ }
|
|
31
|
+
|
26
|
32
|
func updateUI(_ newContext:JitsiMeetContext) {
|
27
|
|
- if let recentURLsArray = newContext.recentURLs {
|
28
|
|
- updateRecents(withRecents: recentURLsArray, currentContext: newContext)
|
29
|
|
- }
|
|
33
|
+ if (newContext.recentURLs == nil || newContext.recentURLs!.count == 0) {
|
|
34
|
+ infoLabel.setText("There are no recent meetings. Please use the app on the phone to start a new call.")
|
|
35
|
+
|
|
36
|
+ table.setHidden(true)
|
|
37
|
+ infoLabel.setHidden(false)
|
|
38
|
+ } else {
|
|
39
|
+ updateRecents(withRecents: newContext.recentURLs!, currentContext: newContext)
|
|
40
|
+
|
|
41
|
+ table.setHidden(false)
|
|
42
|
+ infoLabel.setHidden(true)
|
|
43
|
+ }
|
30
|
44
|
}
|
31
|
45
|
|
32
|
46
|
private func updateRecents(withRecents recents: NSArray, currentContext: JitsiMeetContext) {
|
|
@@ -68,7 +82,7 @@ class InterfaceController: WKInterfaceController {
|
68
|
82
|
override func contextForSegue(withIdentifier segueIdentifier: String, in table: WKInterfaceTable, rowIndex: Int) -> Any? {
|
69
|
83
|
let controller = table.rowController(at: rowIndex) as! MeetingRowController
|
70
|
84
|
let currentContext = ExtensionDelegate.currentJitsiMeetContext
|
71
|
|
-
|
|
85
|
+
|
72
|
86
|
// Copy the current context and add the joinConferenceURL to trigger the command when the in-call screen is displayed
|
73
|
87
|
let actionContext = JitsiMeetContext(jmContext: currentContext)
|
74
|
88
|
actionContext.joinConferenceURL = controller.roomUrl
|