Skip to content

Commit c8472cc

Browse files
committed
fix: confirm remove list not work when restore & import list order wrong
1 parent 8e97439 commit c8472cc

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
### v1.4.3 2/13/2019
2+
3+
- fix: transparent drawer
4+
- fix: always displayed list button
5+
- fix: confirm remove list not work when restore
6+
- fix: import list order wrong
7+
18
### v1.4.2 2/2/2019
29

310
- fix: store into a titled list broken

src/app/page/main/ImportExport.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ export default {
108108
this.processing = true
109109
try {
110110
const lists = await exchange.importFromText(comp, this.importData)
111-
lists.forEach(list => this[ADD_LIST]([list]))
111+
// reverse for keeping the order
112+
lists.reverse().forEach(list => this[ADD_LIST]([list]))
112113
this.showSnackbar(__('ui_main_succeeded'))
113114
this.importData = ''
114115
this.$router.push('/app/list')

src/app/store/lists.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,19 @@ export default {
131131
${__('ui_created')} ${formatTime(list.time)}`)) return
132132
commit(REMOVE_LIST_BY_ID, [list._id])
133133
},
134-
removeTab({commit, state}, [listIndex, tabIndex]) {
134+
removeTab({commit, state, dispatch}, [listIndex, tabIndex]) {
135135
const list = state.lists[listIndex]
136136
const tabs = list.tabs.slice()
137137
tabs.splice(tabIndex, 1)
138-
if (tabs.length === 0) commit(REMOVE_LIST_BY_ID, [list._id])
138+
if (tabs.length === 0) dispatch('removeList', listIndex)
139139
else commit(UPDATE_LIST_BY_ID, [list._id, {tabs}])
140140
},
141-
restoreList({commit, state}, [listIndex, inNewWindow = false]) {
141+
restoreList({state, dispatch}, [listIndex, inNewWindow = false]) {
142142
const list = state.lists[listIndex]
143143
if (inNewWindow) tabManager.restoreListInNewWindow(list)
144144
else tabManager.restoreList(list)
145145
if (list.pinned) return
146-
commit(REMOVE_LIST_BY_ID, [list._id])
146+
dispatch('removeList', listIndex)
147147
},
148148
saveTitle({commit, state}, listIndex) {
149149
const list = state.lists[listIndex]

src/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "__EXT_NAME__",
4-
"version": "1.4.2",
4+
"version": "1.4.3",
55
"default_locale": "en",
66
"description": "__MSG_ext_desc__",
77
"author": "WangJie <[email protected]>",

0 commit comments

Comments
 (0)