@topconsultnpm/sdkui-react-beta 6.14.102 → 6.14.103

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.
@@ -132,42 +132,27 @@ const TMBlogCommentForm = (props) => {
132
132
  // Create an instance of WorkingGroupEngine to interact with the working group
133
133
  const workingGroupEngine = new WorkingGroupEngine(SDK_Globals.tmSession);
134
134
  // Call the BlogPostAddAsync method to add the blog post to the working group
135
- await workingGroupEngine.BlogPostAddAsync(context.object.id, blogPost)
136
- .then(async () => {
137
- await refreshCallback().then(() => updateShouldSelectLastBlog?.(true));
138
- })
139
- .catch((e) => {
140
- // If an error occurs, display the exception in an error box
141
- TMExceptionBoxManager.show({ exception: e });
142
- })
143
- .finally(() => {
144
- // Hide the loading spinner and close the operation (e.g., close a modal or cleanup)
145
- TMSpinner.hide();
146
- onClose();
147
- });
135
+ await workingGroupEngine.BlogPostAddAsync(context.object.id, blogPost);
136
+ await refreshCallback();
137
+ updateShouldSelectLastBlog?.(true);
148
138
  }
149
139
  else if (context.engine === 'SearchEngine') {
150
140
  // Create an instance of SearchEngine
151
141
  const searchEngine = SDK_Globals.tmSession?.NewSearchEngine();
152
- await searchEngine.BlogPostAddAsync(context.object.tid, context.object.did, cleanComment)
153
- .then(async () => {
154
- await refreshCallback().then(() => updateShouldSelectLastBlog?.(true));
155
- })
156
- .catch((e) => {
157
- // If an error occurs, display the exception in an error box
158
- TMExceptionBoxManager.show({ exception: e });
159
- })
160
- .finally(() => {
161
- // Hide the loading spinner and close the operation (e.g., close a modal or cleanup)
162
- TMSpinner.hide();
163
- onClose();
164
- });
142
+ await searchEngine.BlogPostAddAsync(context.object.tid, context.object.did, cleanComment);
143
+ await refreshCallback();
144
+ setTimeout(() => updateShouldSelectLastBlog?.(true), 300);
165
145
  }
166
146
  }
167
147
  catch (e) {
168
148
  // If any error occurs during the try block execution, display the exception in an error box
169
149
  TMExceptionBoxManager.show({ exception: e });
170
150
  }
151
+ finally {
152
+ // Hide the loading spinner and close the operation (e.g., close a modal or cleanup)
153
+ TMSpinner.hide();
154
+ onClose();
155
+ }
171
156
  };
172
157
  const onCloseCallback = () => {
173
158
  if (formData && formData?.comment.length > 0) {
@@ -22,7 +22,7 @@ const TMDcmtBlog = ({ tid, did, isVisible }) => {
22
22
  const fetchDataAsync = async (tid, did) => {
23
23
  try {
24
24
  TMSpinner.show({ description: 'Caricamento - Bacheca...' });
25
- let res = await SDK_Globals.tmSession?.NewSearchEngine().BlogRetrieveAsync(tid, did);
25
+ const res = await SDK_Globals.tmSession?.NewSearchEngine().BlogRetrieveAsync(tid, did);
26
26
  setBlogsDatasource(res ?? []);
27
27
  setHasLoadedDataOnce(true);
28
28
  setLastLoadedDid(did);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.14.102",
3
+ "version": "6.14.103",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",