@momo-kits/native-kits 0.163.2-beta.1-debug → 0.163.2-beta.2-debug

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.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.163.2-beta.1-debug"
43
+ version = "0.163.2-beta.2-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |spec|
2
2
  spec.name = 'compose'
3
- spec.version = '0.163.2-beta.1-debug'
3
+ spec.version = '0.163.2-beta.2-debug'
4
4
  spec.homepage = 'https://momo.vn'
5
5
  spec.source = { :http=> ''}
6
6
  spec.authors = ''
package/gradle.properties CHANGED
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
18
18
  name="ComposeKits"
19
19
  group=vn.momo.kits
20
20
  artifact.id=kits
21
- version=0.163.2-beta.1
21
+ version=0.163.2-beta.2
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
@@ -184,6 +184,22 @@ struct ToolkitHeaderRight: View {
184
184
  }
185
185
  }
186
186
 
187
+ // Load the current favorite state on appear so the star reflects reality; without this the button
188
+ // always renders "not favorited" until the user taps it. Mirrors the Compose LaunchedEffect.
189
+ private func loadFavoriteState() {
190
+ let context = environment.applicationContext
191
+ environment.composeApi?.request(
192
+ funcName: "isFavoriteApp",
193
+ params: ["code": context?.appCode]
194
+ ) { response in
195
+ guard let data = response.data(using: .utf8),
196
+ let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any] else {
197
+ return
198
+ }
199
+ isFavorite = (json["response"] as? Bool) ?? false
200
+ }
201
+ }
202
+
187
203
  private func getNavigationButtonConfig() -> NavigationButtonConfig {
188
204
  let totalTools = headerRight?.tools.reduce(0) { $0 + $1.items.count } ?? 0
189
205
  var icon = isFavorite ? "pin_star_checked" : "pin_star"
@@ -247,6 +263,9 @@ struct ToolkitHeaderRight: View {
247
263
  )
248
264
  .padding(.leading, Spacing.S)
249
265
  }
266
+ .onAppear {
267
+ loadFavoriteState()
268
+ }
250
269
  }
251
270
  }
252
271
 
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.163.2-beta.1'
3
+ s.version = '0.163.2-beta.2'
4
4
  s.summary = 'MoMoUIKits for iOS'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKitsDemo'
3
- s.version = '0.163.2-beta.1'
3
+ s.version = '0.163.2-beta.2'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.163.2-beta.1-debug",
3
+ "version": "0.163.2-beta.2-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},