Skip to content

Commit 4be85b1

Browse files
committed
pref: clear login status only if token expired
1 parent ddc6f85 commit 4be85b1

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
### v1.3.11 10/13/2018
2+
3+
- change: refine i18n strings
4+
- fix: change of openTabListWhenNewTab take effect immediately
5+
- feat: add an option to allow disable open list tab when store all tabs
6+
- pref: clear login status only if token expired
7+
18
### v1.3.10 10/3/2018
29

310
- feat: allow store tabs into a specific list by clicking the items in context menu or a button in the simple list

src/common/service/boss.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,19 @@ const fetchData = async (uri = '', method = 'GET', data = {}) => {
7171
.then(async res => {
7272
if (res.status === 200) {
7373
const json = await res.json()
74+
if (json.status === 'error') throw new Error(json.message)
7475
return json
7576
} else return res.text()
7677
})
7778
.catch(async err => {
7879
// remove expired token
79-
await browser.storage.local.remove(tokenKey)
80-
await browser.storage.local.remove('sync_info')
81-
console.error(err)
82-
throw new Error('Internal Server Error')
80+
if (err.status === 401) {
81+
await browser.storage.local.remove(tokenKey)
82+
await browser.storage.local.remove('sync_info')
83+
} else {
84+
console.error(err)
85+
throw new Error('Internal Server Error')
86+
}
8387
})
8488
}
8589

src/manifest.json

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

0 commit comments

Comments
 (0)