artalk 2.5.1 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Artalk.css +1 -1
- package/dist/Artalk.es.js +7 -5
- package/dist/Artalk.iife.js +1 -1
- package/dist/Artalk.js +1 -1
- package/dist/ArtalkLite.css +1 -1
- package/dist/ArtalkLite.es.js +7 -5
- package/dist/ArtalkLite.iife.js +1 -1
- package/dist/ArtalkLite.js +1 -1
- package/dist/src/api/user.d.ts +1 -1
- package/package.json +1 -1
- package/src/api/user.ts +3 -1
- package/src/artalk.ts +2 -2
- package/src/list/list.ts +1 -1
- package/src/style/main.scss +1 -1
package/dist/src/api/user.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export default class UserApi extends ApiBase {
|
|
|
27
27
|
/** 用户 · 注销 */
|
|
28
28
|
logout(): Promise<unknown>;
|
|
29
29
|
/** 已读标记 */
|
|
30
|
-
markRead(notifyKey: string, readAll?: boolean): Promise<unknown>;
|
|
30
|
+
markRead(commentID: number, notifyKey: string, readAll?: boolean): Promise<unknown>;
|
|
31
31
|
/** 用户 · 列表 */
|
|
32
32
|
userList(offset?: number, limit?: number, type?: 'all' | 'admin' | 'in_conf'): Promise<{
|
|
33
33
|
users: UserDataForAdmin[];
|
package/package.json
CHANGED
package/src/api/user.ts
CHANGED
|
@@ -56,12 +56,14 @@ export default class UserApi extends ApiBase {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/** 已读标记 */
|
|
59
|
-
public markRead(notifyKey: string, readAll = false) {
|
|
59
|
+
public markRead(commentID: number, notifyKey: string, readAll = false) {
|
|
60
60
|
const params: any = {
|
|
61
|
+
comment_id: commentID,
|
|
61
62
|
notify_key: notifyKey,
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
if (readAll) {
|
|
66
|
+
delete params.comment_id
|
|
65
67
|
delete params.notify_key
|
|
66
68
|
params.read_all = true
|
|
67
69
|
params.name = User.data.nick
|
package/src/artalk.ts
CHANGED
|
@@ -32,7 +32,7 @@ export default class Artalk {
|
|
|
32
32
|
public static DisabledComponents: string[] = []
|
|
33
33
|
|
|
34
34
|
constructor(conf: Partial<ArtalkConfig>) {
|
|
35
|
-
if (Artalk.instance)
|
|
35
|
+
if (Artalk.instance) Artalk.destroy()
|
|
36
36
|
|
|
37
37
|
// 初始化基本配置
|
|
38
38
|
this.conf = handelBaseConf(conf)
|
|
@@ -57,7 +57,7 @@ export default class Artalk {
|
|
|
57
57
|
|
|
58
58
|
/** Init Artalk */
|
|
59
59
|
public static init(conf: Partial<ArtalkConfig>): Artalk {
|
|
60
|
-
if (this.instance)
|
|
60
|
+
if (this.instance) Artalk.destroy()
|
|
61
61
|
this.instance = new Artalk(conf)
|
|
62
62
|
return this.instance
|
|
63
63
|
}
|
package/src/list/list.ts
CHANGED
|
@@ -142,7 +142,7 @@ export default class List extends ListLite {
|
|
|
142
142
|
// 已阅 API
|
|
143
143
|
const notifyKey = Utils.getQueryParam('atk_notify_key')
|
|
144
144
|
if (notifyKey) {
|
|
145
|
-
this.ctx.getApi().user.markRead(notifyKey)
|
|
145
|
+
this.ctx.getApi().user.markRead(commentId, notifyKey)
|
|
146
146
|
.then(() => {
|
|
147
147
|
this.unread = this.unread.filter(o => o.comment_id !== commentId)
|
|
148
148
|
this.updateUnread(this.unread)
|
package/src/style/main.scss
CHANGED