@react-native-ohos/react-native-svg 15.12.1-rc.8 → 15.12.1-rc.9

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.
@@ -6,7 +6,7 @@
6
6
  name: '@react-native-ohos/react-native-svg',
7
7
  type: 'module',
8
8
  main: 'index.ets',
9
- version: '15.12.1-rc.8',
9
+ version: '15.12.1-rc.9',
10
10
  dependencies: {
11
11
  "@rnoh/react-native-openharmony": "file:../../node_modules/@react-native-oh/react-native-harmony/harmony/react_native_openharmony.har"
12
12
  },
@@ -105,21 +105,28 @@ void ImageSourceResolver::imageDownloadComplete(std::string uri, std::string fil
105
105
  }
106
106
 
107
107
  void ImageSourceResolver::imageDownloadFail(std::string uri) {
108
- auto pend = m_pendingSet.find(uri);
109
- if (pend != m_pendingSet.end()) {
110
- m_pendingSet.erase(uri);
111
- }
112
-
113
- auto it = m_uriListenersMap.find(uri);
114
- if (it == m_uriListenersMap.end()) {
108
+ if (uri.empty()) {
115
109
  return;
116
110
  }
117
- auto &listeners = it->second;
118
- for (auto listener : listeners) {
119
-
120
- auto weaklistener = listener.lock();
121
- weaklistener->onImageSourceCacheDownloadFileFail();
122
- removeListenerForURI(uri, weaklistener);
111
+ if (!m_pendingSet.empty()) {
112
+ auto pend = m_pendingSet.find(uri);
113
+ if (pend != m_pendingSet.end()) {
114
+ m_pendingSet.erase(uri);
115
+ }
116
+ }
117
+ if (!m_uriListenersMap.empty()) {
118
+ auto it = m_uriListenersMap.find(uri);
119
+ if (it == m_uriListenersMap.end()) {
120
+ return;
121
+ }
122
+ auto &listeners = it->second;
123
+ for (auto listener : listeners) {
124
+ auto weaklistener = listener.lock();
125
+ if (weaklistener) {
126
+ weaklistener->onImageSourceCacheDownloadFileFail();
127
+ removeListenerForURI(uri, weaklistener);
128
+ }
129
+ }
123
130
  }
124
131
  }
125
132
 
package/harmony/svg.har CHANGED
Binary file
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@react-native-ohos/react-native-svg",
3
- "version": "15.12.1-rc.8",
3
+ "version": "15.12.1-rc.9",
4
4
  "description": "",
5
5
  "react-native": "src/index",
6
6
  "main": "lib/commonjs/index",
7
7
  "module": "lib/module/index",
8
8
  "types": "lib/typescript/index.d.ts",
9
9
  "scripts": {
10
+ "prepack": "bob build",
10
11
  "prepublishOnly": "npm run prepack && react-native verify-package-harmony --package-path . --skip-checks oh_package_name_is_derived_from_npm_package_name",
11
12
  "update_version": "node ./scripts/update-version.js",
12
13
  "deploy": "node ./scripts/deploy.js",
@@ -20,7 +21,7 @@
20
21
  "react-native-svg": "15.12.0"
21
22
  },
22
23
  "devDependencies": {
23
- "@rnoh/react-native-harmony-cli": "./packages/rnoh-react-native-harmony-cli-0.77.10.tgz",
24
+ "@rnoh/react-native-harmony-cli": "./packages/react-native-oh-react-native-harmony-cli-0.77.18.tgz",
24
25
  "@react-native-community/cli": "15.0.1",
25
26
  "@tsconfig/react-native": "^3.0.0",
26
27
  "@types/jest": "^29.5.1",
@@ -46,8 +47,7 @@
46
47
  "output": "lib",
47
48
  "targets": [
48
49
  "commonjs",
49
- "module",
50
- "typescript"
50
+ "module"
51
51
  ]
52
52
  }
53
53
  }