@silexlabs/silex 3.0.0-alpha.164 → 3.0.0-alpha.166

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silexlabs/silex",
3
3
  "description": "Free and easy website builder for everyone.",
4
- "version": "3.0.0-alpha.164",
4
+ "version": "3.0.0-alpha.166",
5
5
  "version:backwardcompat": "3.0.0",
6
6
  "author": {
7
7
  "name": "Alex Hoyau",
@@ -160,7 +160,8 @@ export class PublicationManager {
160
160
  }
161
161
  this.status = PublicationStatus.STATUS_NONE
162
162
  // Save the website with the new settings
163
- await this.editor.store(null)
163
+ // WIP: prevent saving during publication
164
+ // await this.editor.store(null)
164
165
  // Display the dialog
165
166
  this.dialog && this.dialog.displayPending(this.job, this.status)
166
167
  return
@@ -190,7 +191,8 @@ export class PublicationManager {
190
191
  this.settings.options = data.options
191
192
  this.status = PublicationStatus.STATUS_NONE
192
193
  // Save the website with the new settings
193
- await this.editor.store(null)
194
+ // WIP: prevent saving during publication
195
+ // await this.editor.store(null)
194
196
  // Display the dialog
195
197
  this.dialog && this.dialog.displayPending(this.job, this.status)
196
198
  //await this.startPublication()
@@ -19,6 +19,8 @@ import { ConnectorId, WebsiteId, WebsiteData, ConnectorUser, ConnectorType, ApiE
19
19
  import { websiteLoad, websiteSave } from '../api'
20
20
  import { cmdLogin, eventLoggedIn, eventLoggedOut, getCurrentUser, updateUser } from './LoginDialog'
21
21
  import { addTempDataToPages, addTempDataToAssetUrl, addTempDataToStyles, removeTempDataFromAssetUrl, removeTempDataFromPages, removeTempDataFromStyles } from '../assetUrl'
22
+ import { PublicationStatus } from './PublicationManager'
23
+ import { ClientEvent } from '../events'
22
24
 
23
25
  export const storagePlugin = (editor) => {
24
26
  editor.Storage.add('connector', {
@@ -57,6 +59,13 @@ export const storagePlugin = (editor) => {
57
59
  },
58
60
 
59
61
  async store(data: WebsiteData, options: { id: WebsiteId, connectorId: ConnectorId }) {
62
+ console.log('store', editor.PublicationManager.status, PublicationStatus.STATUS_PENDING)
63
+ if(editor.PublicationManager.status === PublicationStatus.STATUS_PENDING) {
64
+ console.warn('Publication is pending, saving later')
65
+ return new Promise((resolve) => {
66
+ editor.once(ClientEvent.PUBLISH_END, () => resolve(this.store(data, options)))
67
+ })
68
+ }
60
69
  try {
61
70
  if(await getCurrentUser(editor)) {
62
71
  const user = await getCurrentUser(editor)