@capgo/capacitor-updater 8.47.5 → 8.47.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -20
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +380 -92
- package/android/src/main/java/ee/forgr/capacitor_updater/CapgoUpdater.java +279 -259
- package/android/src/main/java/ee/forgr/capacitor_updater/DownloadService.java +23 -26
- package/android/src/main/java/ee/forgr/capacitor_updater/ShakeMenu.java +111 -62
- package/dist/docs.json +5 -5
- package/dist/esm/definitions.d.ts +16 -24
- package/dist/esm/definitions.js.map +1 -1
- package/ios/Sources/CapacitorUpdaterPlugin/CapacitorUpdaterPlugin.swift +343 -46
- package/ios/Sources/CapacitorUpdaterPlugin/CapgoUpdater.swift +1 -1
- package/ios/Sources/CapacitorUpdaterPlugin/InternalUtils.swift +1 -1
- package/ios/Sources/CapacitorUpdaterPlugin/ShakeMenu.swift +25 -8
- package/package.json +1 -1
|
@@ -33,17 +33,20 @@ extension UIWindow {
|
|
|
33
33
|
return
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
let canShowPreviewMenu = plugin.shakeMenuEnabled && plugin.hasActivePreviewSession()
|
|
37
|
+
let canShowChannelSelector = plugin.shakeChannelSelectorEnabled
|
|
38
|
+
|
|
39
|
+
if !canShowPreviewMenu && !canShowChannelSelector {
|
|
40
|
+
if plugin.shakeMenuEnabled {
|
|
41
|
+
plugin.logger.info("Shake preview menu ignored because no preview session is active")
|
|
42
|
+
}
|
|
38
43
|
return
|
|
39
44
|
}
|
|
40
45
|
|
|
41
|
-
if
|
|
46
|
+
if canShowPreviewMenu {
|
|
42
47
|
showDefaultMenu(plugin: plugin, bridge: bridge)
|
|
43
|
-
} else if plugin.shakeChannelSelectorEnabled {
|
|
44
|
-
showChannelSelector(plugin: plugin, bridge: bridge)
|
|
45
48
|
} else {
|
|
46
|
-
|
|
49
|
+
showChannelSelector(plugin: plugin, bridge: bridge)
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
52
|
}
|
|
@@ -56,8 +59,8 @@ extension UIWindow {
|
|
|
56
59
|
return
|
|
57
60
|
}
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
guard plugin.hasActivePreviewSession() else {
|
|
63
|
+
plugin.logger.info("Shake preview menu ignored because no preview session is active")
|
|
61
64
|
return
|
|
62
65
|
}
|
|
63
66
|
|
|
@@ -90,6 +93,20 @@ extension UIWindow {
|
|
|
90
93
|
}
|
|
91
94
|
})
|
|
92
95
|
|
|
96
|
+
if plugin.shakeChannelSelectorEnabled {
|
|
97
|
+
alertShake.addAction(UIAlertAction(title: "Switch channel", style: .default) { _ in
|
|
98
|
+
let showSelector = {
|
|
99
|
+
self.showChannelSelector(plugin: plugin, bridge: bridge)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if let presenter = alertShake.presentingViewController {
|
|
103
|
+
presenter.dismiss(animated: true, completion: showSelector)
|
|
104
|
+
} else {
|
|
105
|
+
DispatchQueue.main.async(execute: showSelector)
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
93
110
|
alertShake.addAction(UIAlertAction(title: cancelButtonTitle, style: .default))
|
|
94
111
|
|
|
95
112
|
DispatchQueue.main.async {
|