Sha256: c8ee72cdb6b340593e98b27bcd568a06723ddb4e894998a272808cbf63c9634c

Contents?: true

Size: 874 Bytes

Versions: 6

Compression:

Stored size: 874 Bytes

Contents

export default (services) => ({
  fetchSite({ commit }, locally) {
    services.site.find(locally).then((site) => {
      const { style, ...rawSite } = site
      services.api.setSiteHandle(site.handle)
      commit('SET_SITE', rawSite)
      commit('SET_STYLE', style)
    })
  },
  loadPublishButtonState({ commit }) {
    services.site
      .getLastPublication()
      .then((data) => commit('SET_PUBLISH_BUTTON_STATE', data))
  },
  async publishSite({ commit }) {
    services.site
      .publish()
      .then((data) => commit('SET_PUBLISH_BUTTON_STATE', data))
  },
  pollLastPublication({ dispatch }) {
    dispatch('loadPublishButtonState')
    setInterval(() => dispatch('loadPublishButtonState'), 5000)
  },
  previewStyle({ commit, getters }, newStyle) {
    commit('SET_STYLE', newStyle)
    services.livePreview.updateStyle(getters.content, newStyle)
  },
})

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
maglevcms-1.1.5 app/frontend/editor/store/actions/site.js
maglevcms-1.1.4 app/frontend/editor/store/actions/site.js
maglevcms-1.1.3 app/frontend/editor/store/actions/site.js
maglevcms-1.1.2 app/frontend/editor/store/actions/site.js
maglevcms-1.1.1 app/frontend/editor/store/actions/site.js
maglevcms-1.1.0 app/frontend/editor/store/actions/site.js