artalk 2.5.1 → 2.5.2

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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artalk",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "license": "LGPL-3.0",
5
5
  "description": "A Selfhosted Comment System",
6
6
  "keywords": [
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) return Artalk.instance.update(conf)
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) return this.instance.update(conf) // 单例模式
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)
@@ -51,7 +51,7 @@
51
51
  line-height: $line-height;
52
52
  display: block;
53
53
  padding: 10px 15px;
54
- white-space: pre-wrap;
54
+ white-space: pre-wrap !important;
55
55
  background-color: var(--at-color-bg-grey);
56
56
  color: var(--at-color-font);
57
57
  margin: 0;