Skip to content

Commit

Permalink
fix: confirm remove list not work when restore & import list order wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
cnwangjie committed Feb 13, 2019
1 parent 8e97439 commit c8472cc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### v1.4.3 2/13/2019

- fix: transparent drawer
- fix: always displayed list button
- fix: confirm remove list not work when restore
- fix: import list order wrong

### v1.4.2 2/2/2019

- fix: store into a titled list broken
Expand Down
3 changes: 2 additions & 1 deletion src/app/page/main/ImportExport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ export default {
this.processing = true
try {
const lists = await exchange.importFromText(comp, this.importData)
lists.forEach(list => this[ADD_LIST]([list]))
// reverse for keeping the order
lists.reverse().forEach(list => this[ADD_LIST]([list]))
this.showSnackbar(__('ui_main_succeeded'))
this.importData = ''
this.$router.push('/app/list')
Expand Down
8 changes: 4 additions & 4 deletions src/app/store/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ export default {
${__('ui_created')} ${formatTime(list.time)}`)) return
commit(REMOVE_LIST_BY_ID, [list._id])
},
removeTab({commit, state}, [listIndex, tabIndex]) {
removeTab({commit, state, dispatch}, [listIndex, tabIndex]) {
const list = state.lists[listIndex]
const tabs = list.tabs.slice()
tabs.splice(tabIndex, 1)
if (tabs.length === 0) commit(REMOVE_LIST_BY_ID, [list._id])
if (tabs.length === 0) dispatch('removeList', listIndex)
else commit(UPDATE_LIST_BY_ID, [list._id, {tabs}])
},
restoreList({commit, state}, [listIndex, inNewWindow = false]) {
restoreList({state, dispatch}, [listIndex, inNewWindow = false]) {
const list = state.lists[listIndex]
if (inNewWindow) tabManager.restoreListInNewWindow(list)
else tabManager.restoreList(list)
if (list.pinned) return
commit(REMOVE_LIST_BY_ID, [list._id])
dispatch('removeList', listIndex)
},
saveTitle({commit, state}, listIndex) {
const list = state.lists[listIndex]
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": "__EXT_NAME__",
"version": "1.4.2",
"version": "1.4.3",
"default_locale": "en",
"description": "__MSG_ext_desc__",
"author": "WangJie <doudou19758@gmail.com>",
Expand Down

0 comments on commit c8472cc

Please sign in to comment.