@capgo/capacitor-updater 6.51.18 → 6.51.21

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.
@@ -151,59 +151,34 @@ public class DelayUpdateUtils {
151
151
  }
152
152
 
153
153
  public func setMultiDelay(delayConditions: String) -> Bool {
154
- do {
155
- UserDefaults.standard.set(delayConditions, forKey: DelayUpdateUtils.DELAY_CONDITION_PREFERENCES)
156
- UserDefaults.standard.synchronize()
157
- logger.info("Delay update saved")
158
- return true
159
- } catch {
160
- logger.error("Failed to delay update, [Error calling 'setMultiDelay()']: \(error)")
161
- return false
162
- }
154
+ UserDefaults.standard.set(delayConditions, forKey: DelayUpdateUtils.DELAY_CONDITION_PREFERENCES)
155
+ UserDefaults.standard.synchronize()
156
+ logger.info("Delay update saved")
157
+ return true
163
158
  }
164
159
 
165
160
  public func setBackgroundTimestamp(_ backgroundTimestamp: Int64) {
166
- do {
167
- UserDefaults.standard.set(backgroundTimestamp, forKey: DelayUpdateUtils.BACKGROUND_TIMESTAMP_KEY)
168
- UserDefaults.standard.synchronize()
169
- logger.info("Background timestamp saved")
170
- } catch {
171
- logger.error("Failed to save background timestamp, [Error calling 'setBackgroundTimestamp()']: \(error)")
172
- }
161
+ UserDefaults.standard.set(backgroundTimestamp, forKey: DelayUpdateUtils.BACKGROUND_TIMESTAMP_KEY)
162
+ UserDefaults.standard.synchronize()
163
+ logger.info("Background timestamp saved")
173
164
  }
174
165
 
175
166
  public func unsetBackgroundTimestamp() {
176
- do {
177
- UserDefaults.standard.removeObject(forKey: DelayUpdateUtils.BACKGROUND_TIMESTAMP_KEY)
178
- UserDefaults.standard.synchronize()
179
- logger.info("Background timestamp removed")
180
- } catch {
181
- // swiftlint:disable:next line_length
182
- logger.error("Failed to remove background timestamp, [Error calling 'unsetBackgroundTimestamp()']: \(error)")
183
- }
167
+ UserDefaults.standard.removeObject(forKey: DelayUpdateUtils.BACKGROUND_TIMESTAMP_KEY)
168
+ UserDefaults.standard.synchronize()
169
+ logger.info("Background timestamp removed")
184
170
  }
185
171
 
186
172
  private func getBackgroundTimestamp() -> Int64 {
187
- do {
188
- let key = DelayUpdateUtils.BACKGROUND_TIMESTAMP_KEY
189
- let timestamp = UserDefaults.standard.object(forKey: key) as? Int64 ?? 0
190
- return timestamp
191
- } catch {
192
- logger.error("Failed to get background timestamp, [Error calling 'getBackgroundTimestamp()']: \(error)")
193
- return 0
194
- }
173
+ let key = DelayUpdateUtils.BACKGROUND_TIMESTAMP_KEY
174
+ return UserDefaults.standard.object(forKey: key) as? Int64 ?? 0
195
175
  }
196
176
 
197
177
  public func cancelDelay(source: String) -> Bool {
198
- do {
199
- UserDefaults.standard.removeObject(forKey: DelayUpdateUtils.DELAY_CONDITION_PREFERENCES)
200
- UserDefaults.standard.synchronize()
201
- logger.info("All delays canceled from \(source)")
202
- return true
203
- } catch {
204
- logger.error("Failed to cancel update delay: \(error)")
205
- return false
206
- }
178
+ UserDefaults.standard.removeObject(forKey: DelayUpdateUtils.DELAY_CONDITION_PREFERENCES)
179
+ UserDefaults.standard.synchronize()
180
+ logger.info("All delays canceled from \(source)")
181
+ return true
207
182
  }
208
183
 
209
184
  // MARK: - Helper methods
@@ -792,9 +792,9 @@ extension UIWindow {
792
792
  message: "Update downloaded! Reload to apply version \(latest.version)?",
793
793
  plugin: plugin,
794
794
  bridge: bridge,
795
- onReload: { [weak plugin] in
795
+ onReload: {
796
796
  _ = updater.set(bundle: bundle)
797
- _ = plugin?._reload()
797
+ _ = plugin._reload()
798
798
  }
799
799
  )
800
800
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "6.51.18",
3
+ "version": "6.51.21",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Live update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",
@@ -63,7 +63,7 @@
63
63
  "test:maestro:ios:smoke": "./scripts/test-maestro-ios.sh",
64
64
  "lint": "bun run eslint && bun run prettier -- --check && bun run swiftlint -- lint",
65
65
  "fmt": "bun run eslint -- --fix && bun run prettier -- --write && bun run swiftlint -- --fix --format",
66
- "eslint": "eslint . --ext .ts",
66
+ "eslint": "eslint .",
67
67
  "prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
68
68
  "swiftlint": "node-swiftlint",
69
69
  "docgen": "node scripts/generate-docs.js",
@@ -87,12 +87,13 @@
87
87
  "@capacitor/core": "^6.0.0",
88
88
  "@capacitor/docgen": "^0.3.0",
89
89
  "@capacitor/ios": "^6.0.0",
90
- "@ionic/eslint-config": "^0.4.0",
90
+ "@ionic/eslint-config": "^0.5.0",
91
+ "@typescript-eslint/eslint-plugin": "^8.70.0",
92
+ "@typescript-eslint/parser": "^8.70.0",
91
93
  "@ionic/prettier-config": "^4.0.0",
92
94
  "@ionic/swiftlint-config": "^2.0.0",
93
95
  "@types/node": "^26.0.0",
94
- "eslint": "^8.57.0",
95
- "eslint-plugin-import": "^2.32.0",
96
+ "eslint": "^10.0.0",
96
97
  "husky": "^9.1.7",
97
98
  "prettier": "^3.6.2",
98
99
  "prettier-plugin-java": "^2.7.4",
@@ -107,9 +108,6 @@
107
108
  },
108
109
  "prettier": "@ionic/prettier-config",
109
110
  "swiftlint": "@ionic/swiftlint-config",
110
- "eslintConfig": {
111
- "extends": "@ionic/eslint-config/recommended"
112
- },
113
111
  "capacitor": {
114
112
  "ios": {
115
113
  "src": "ios"