@gudhub/core 1.1.52 → 1.1.53

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.
@@ -127,7 +127,7 @@ export class AppProcessor {
127
127
  return this.getAppFromStorage(app.app_id);
128
128
  }
129
129
 
130
- updatingAppInStorage(app) {
130
+ updateAppFieldsAndViews(app) {
131
131
  const storageApp = this.getAppFromStorage(app.app_id);
132
132
  app.items_list = storageApp.items_list;
133
133
  app.file_list = storageApp.file_list;
@@ -151,6 +151,25 @@ export class AppProcessor {
151
151
  });
152
152
  }
153
153
 
154
+ updateAppInStorage(app) {
155
+ const storageApp = this.storage.getApp(app.app_id);
156
+ if (storageApp) {
157
+ this.storage.updateApp(app);
158
+ this.pipeService.emit(
159
+ "gh_app_update",
160
+ { app_id: app.app_id },
161
+ app
162
+ );
163
+ this.pipeService.emit(
164
+ "gh_items_update",
165
+ { app_id: app.app_id },
166
+ app.items_list
167
+ );
168
+ } else {
169
+ this.addNewAppToStorage(app)
170
+ };
171
+ }
172
+
154
173
  deletingAppFromStorage(app_id) {
155
174
  let appList = this.storage.getAppsList();
156
175
  appList.forEach((app, key) => {
@@ -186,8 +205,7 @@ export class AppProcessor {
186
205
  app.items_object[app.items_list[item].item_id][app.items_list[item].fields[field].field_id] = app.items_list[item].fields[field];
187
206
  }
188
207
  }
189
-
190
- this.updatingAppInStorage(app);
208
+ this.updateAppInStorage(app);
191
209
  }
192
210
  } catch (err) {
193
211
  console.log(err);
@@ -293,7 +311,7 @@ export class AppProcessor {
293
311
  }
294
312
 
295
313
  const updatedApp = await this.updateAppApi(app);
296
- this.updatingAppInStorage(updatedApp);
314
+ this.updateAppFieldsAndViews(updatedApp);
297
315
  return updatedApp;
298
316
  }
299
317
 
@@ -612,8 +612,8 @@ export default function generateModulesList(async_modules_path, file_server_url,
612
612
  data_type: "editorjs",
613
613
  name: 'EditorJS',
614
614
  icon: 'code_editor',
615
- js: "https://gudhub.com/modules/Editor-Js/dist/main.js",
616
- css: "https://gudhub.com/modules/Editor-Js/dist/style.css",
615
+ js: "https://gudhub.com/modules/Editor-Js/dist/main.js?t=1",
616
+ css: "https://gudhub.com/modules/Editor-Js/dist/style.css?t=1",
617
617
  type: 'gh_element',
618
618
  technology: 'class'
619
619
  },
@@ -50,7 +50,11 @@ export class WebSocketApi {
50
50
  console.log("websocket close");
51
51
 
52
52
  this.connected = false;
53
- this.initWebSocket(this.onMassageHandler, this.refreshAppsHandler);
53
+ try {
54
+ this.initWebSocket(this.onMassageHandler, this.refreshAppsHandler);
55
+ } catch (error) {
56
+ console.log(error);
57
+ }
54
58
  }
55
59
 
56
60
  async onMessage(event) {
@@ -20,7 +20,7 @@ export function WebsocketHandler(gudhub, message) {
20
20
  break;
21
21
  case "/app/update":
22
22
  console.log("/app/update - ", message);
23
- gudhub.appProcessor.updatingAppInStorage(message.response);
23
+ gudhub.appProcessor.updateAppFieldsAndViews(message.response);
24
24
  break;
25
25
  case "/file/delete":
26
26
  console.log("file/delete - ", message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gudhub/core",
3
- "version": "1.1.52",
3
+ "version": "1.1.53",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {