Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
follow ups to fix for #9308
Browse files Browse the repository at this point in the history
fix #9405
fix #9404
  • Loading branch information
diracdeltas committed Jun 12, 2017
1 parent ba4d7d4 commit 52bbcaf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/sessionStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ module.exports.cleanAppData = (data, isShutdown) => {
if (data.dragData) {
delete data.dragData
}
if (data.sync) {
// clear sync site cache
data.sync.objectsById = {}
}
const clearSiteSettings = isShutdown && getSetting(settings.SHUTDOWN_CLEAR_SITE_SETTINGS) === true
if (clearSiteSettings) {
data.siteSettings = {}
Expand Down
5 changes: 5 additions & 0 deletions app/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ const appStoreChangeCallback = function (diffs) {
const entry = state.getIn(statePath)
const isSite = type === 'sites'

if (action === writeActions.CREATE && entry && entry.get('skipSync')) {
// Don't re-create objects that were fetched by sync
return
}

if (isSite && action === writeActions.DELETE && !entry) {
// If we deleted the site, it is no longer availble in appState.
// Find the corresponding objectId using the sync cache
Expand Down

0 comments on commit 52bbcaf

Please sign in to comment.