Skip to content

Commit

Permalink
1.3.2: fix a sync bug
Browse files Browse the repository at this point in the history
fix: make conflict if local is not empty after login
  • Loading branch information
cnwangjie committed Sep 5, 2018
1 parent 1d5bfbf commit 270d45c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### v1.3.2 9/5/2018

- pref: use vuex store options and login status
- feat: add an option to alert before removing list
- fix: make conflict if local is not empty after login (avoid directly downloading if local is not empty)

### v1.3.1 9/2/2018

- feat: add an option to allow using night mode by default
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "__MSG_ext_name__",
"version": "1.3.1",
"version": "1.3.2",
"default_locale": "en",
"description": "__MSG_ext_desc__",
"author": "WangJie <[email protected]>",
Expand Down
7 changes: 6 additions & 1 deletion src/page/SyncInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
</template>

<script>
import _ from 'lodash'
import __ from '@/common/i18n'
import {formatTime, one} from '@/common/utils'
import boss from '@/common/service/boss'
Expand Down Expand Up @@ -237,7 +238,11 @@ export default {
this.bossinfo = await boss.getInfo()
await browser.storage.local.set({sync_info: this.bossinfo})
await this.loadSyncInfo()
chrome.runtime.sendMessage({forceDownload: true})
const localInfo = await browser.storage.local.get(['listsUpdatedAt', 'optsUpdatedAt'])
const {lists} = await browser.storage.local.get(['lists'])
// if never uploaded but there are lists in the local making a conflict first
if (_.isEmpty(localInfo) && !_.isEmpty(lists)) chrome.runtime.sendMessage({uploadImmediate: true})
else chrome.runtime.sendMessage({forceDownload: true})
},
async resolveConflict(type, result) {
chrome.runtime.sendMessage({resolveConflict: {type, result}})
Expand Down

0 comments on commit 270d45c

Please sign in to comment.