@liujitcn/kratos-taro-app-system 0.0.28 → 0.0.31
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/README.md +6 -2
- package/dist/build.mjs +3 -1
- package/dist/module.mjs +526 -0
- package/package.json +9 -4
- package/src/api/base/notification.ts +61 -0
- package/src/index.ts +16 -15
- package/src/locales/README.md +2 -1
- package/src/locales/en-US.json +25 -1
- package/src/locales/ja-JP.json +25 -1
- package/src/locales/zh-CN.json +25 -1
- package/src/locales/zh-TW.json +25 -1
- package/src/module.ts +20 -0
- package/src/notification.ts +100 -0
- package/src/pages.ts +2 -0
- package/src/rpc/base/v1/notification.ts +315 -0
- package/src/rpc/google/protobuf/empty.ts +19 -0
- package/src/views/pagesMember/message/detail.tsx +56 -0
- package/src/views/pagesMember/message/index.tsx +216 -0
- package/src/views/pagesMember/message/message.scss +147 -0
- package/src/views/pagesMember/settings/components/PasswordVerifyDialog.scss +123 -0
- package/src/views/pagesMember/settings/components/PasswordVerifyDialog.tsx +360 -0
- package/src/views/pagesMember/settings/settings.scss +16 -0
- package/src/views/pagesMember/settings/settings.tsx +139 -39
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { http } from '@liujitcn/kratos-taro-app-core/utils/http'
|
|
2
|
+
import type {
|
|
3
|
+
ArchiveNotificationRequest,
|
|
4
|
+
DeleteNotificationRequest,
|
|
5
|
+
GetNotificationRequest,
|
|
6
|
+
GetNotificationSummaryRequest,
|
|
7
|
+
MarkAllNotificationReadRequest,
|
|
8
|
+
MarkNotificationReadRequest,
|
|
9
|
+
MarkNotificationUnreadRequest,
|
|
10
|
+
Notification,
|
|
11
|
+
NotificationService,
|
|
12
|
+
NotificationSummary,
|
|
13
|
+
PageNotificationRequest,
|
|
14
|
+
PageNotificationResponse,
|
|
15
|
+
RestoreNotificationRequest,
|
|
16
|
+
} from '../../rpc/base/v1/notification'
|
|
17
|
+
import type { Empty } from '../../rpc/google/protobuf/empty'
|
|
18
|
+
|
|
19
|
+
const NOTIFICATION_URL = '/v1/base/notification'
|
|
20
|
+
|
|
21
|
+
/** Taro 当前用户站内信服务。 */
|
|
22
|
+
export class NotificationServiceImpl implements NotificationService {
|
|
23
|
+
/** 分页查询收件箱。 */
|
|
24
|
+
PageNotification(request: PageNotificationRequest): Promise<PageNotificationResponse> {
|
|
25
|
+
return http({ url: NOTIFICATION_URL, method: 'GET', authMode: 'required', data: request })
|
|
26
|
+
}
|
|
27
|
+
/** 查询消息详情。 */
|
|
28
|
+
GetNotification(request: GetNotificationRequest): Promise<Notification> {
|
|
29
|
+
return http({ url: `${NOTIFICATION_URL}/${request.id}`, method: 'GET', authMode: 'required' })
|
|
30
|
+
}
|
|
31
|
+
/** 查询未读汇总。 */
|
|
32
|
+
GetNotificationSummary(request: GetNotificationSummaryRequest): Promise<NotificationSummary> {
|
|
33
|
+
return http({ url: `${NOTIFICATION_URL}/summary`, method: 'GET', authMode: 'required', data: request })
|
|
34
|
+
}
|
|
35
|
+
/** 标记消息已读。 */
|
|
36
|
+
MarkNotificationRead(request: MarkNotificationReadRequest): Promise<Empty> {
|
|
37
|
+
return http({ url: `${NOTIFICATION_URL}/read`, method: 'PUT', authMode: 'required', data: request })
|
|
38
|
+
}
|
|
39
|
+
/** 标记消息未读。 */
|
|
40
|
+
MarkNotificationUnread(request: MarkNotificationUnreadRequest): Promise<Empty> {
|
|
41
|
+
return http({ url: `${NOTIFICATION_URL}/unread`, method: 'PUT', authMode: 'required', data: request })
|
|
42
|
+
}
|
|
43
|
+
/** 标记全部消息已读。 */
|
|
44
|
+
MarkAllNotificationRead(request: MarkAllNotificationReadRequest): Promise<Empty> {
|
|
45
|
+
return http({ url: `${NOTIFICATION_URL}/read/all`, method: 'PUT', authMode: 'required', data: request })
|
|
46
|
+
}
|
|
47
|
+
/** 归档消息。 */
|
|
48
|
+
ArchiveNotification(request: ArchiveNotificationRequest): Promise<Empty> {
|
|
49
|
+
return http({ url: `${NOTIFICATION_URL}/${request.id}/archive`, method: 'PUT', authMode: 'required', data: request })
|
|
50
|
+
}
|
|
51
|
+
/** 恢复已归档消息。 */
|
|
52
|
+
RestoreNotification(request: RestoreNotificationRequest): Promise<Empty> {
|
|
53
|
+
return http({ url: `${NOTIFICATION_URL}/${request.id}/restore`, method: 'PUT', authMode: 'required', data: request })
|
|
54
|
+
}
|
|
55
|
+
/** 从个人收件箱删除消息。 */
|
|
56
|
+
DeleteNotification(request: DeleteNotificationRequest): Promise<Empty> {
|
|
57
|
+
return http({ url: `${NOTIFICATION_URL}/${request.id}`, method: 'DELETE', authMode: 'required' })
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const defNotificationService = new NotificationServiceImpl()
|
package/src/index.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { registerUserStoreExtension } from '@liujitcn/kratos-taro-app-core/stores'
|
|
2
|
+
import { systemModule } from './module'
|
|
3
|
+
import {
|
|
4
|
+
pauseNotificationPolling,
|
|
5
|
+
resumeNotificationPolling,
|
|
6
|
+
startNotificationPolling,
|
|
7
|
+
stopNotificationPolling,
|
|
8
|
+
} from './notification'
|
|
5
9
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
views: {
|
|
11
|
-
PROFILE_HOME: 'pages/my/my',
|
|
12
|
-
PROFILE: 'pagesMember/profile/profile',
|
|
13
|
-
SETTINGS: 'pagesMember/settings/settings',
|
|
14
|
-
AI: 'pagesMember/ai/index',
|
|
15
|
-
},
|
|
16
|
-
messages: LOCALE_MESSAGES,
|
|
10
|
+
registerUserStoreExtension({
|
|
11
|
+
onLogin: startNotificationPolling,
|
|
12
|
+
onLogout: stopNotificationPolling,
|
|
13
|
+
onSilentLogout: stopNotificationPolling,
|
|
17
14
|
})
|
|
15
|
+
|
|
16
|
+
export { pauseNotificationPolling, resumeNotificationPolling }
|
|
17
|
+
export { systemModule }
|
|
18
|
+
export default systemModule
|
package/src/locales/README.md
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
| `zh-CN.json` | System 模块简体中文固定 UI 默认语言包,也是所有语言键集合和占位符校验基准。 | Taro 固定文案默认语言及缺失翻译回退。 |
|
|
8
8
|
| `zh-TW.json` | System 模块繁体中文语言包。 | Taro 切换为繁体中文时使用。 |
|
|
9
9
|
| `en-US.json` | System 模块英文语言包。 | Taro 切换为英文时使用。 |
|
|
10
|
+
| `ja-JP.json` | System 模块日文语言包。 | Taro 切换为日文时使用。 |
|
|
10
11
|
|
|
11
12
|
语言键必须使用 `system.` 命名空间;语言包保持标准 JSON,不在文件内写注释。新增语言后执行仓库根目录的 `make i18n-sync`。
|
|
12
13
|
|
|
13
|
-
新增语言的完整文件清单和迁移流程见[国际化语言扩展指南](
|
|
14
|
+
新增语言的完整文件清单和迁移流程见[国际化语言扩展指南](../../../../../../../docs/国际化语言扩展指南.md)。
|
package/src/locales/en-US.json
CHANGED
|
@@ -87,5 +87,29 @@
|
|
|
87
87
|
"system.settings.go_ask": "Ask now",
|
|
88
88
|
"system.settings.logout_confirm": "Log out now?",
|
|
89
89
|
"system.settings.logout_failed": "Logout failed",
|
|
90
|
-
"system.settings.title": "Settings"
|
|
90
|
+
"system.settings.title": "Settings",
|
|
91
|
+
"system.settings.mfa_title": "Multi-factor authentication",
|
|
92
|
+
"system.settings.mfa_enabled_method": "Enabled ({method})",
|
|
93
|
+
"system.settings.mfa_disabled": "Not enabled",
|
|
94
|
+
"system.settings.mfa_method_totp": "TOTP",
|
|
95
|
+
"system.settings.mfa_method_webauthn": "WebAuthn",
|
|
96
|
+
"system.settings.mfa_bind_success": "Multi-factor authentication enabled",
|
|
97
|
+
"system.settings.mfa_disable_title": "Disable multi-factor authentication",
|
|
98
|
+
"system.settings.mfa_disable_factor_required": "Enter a TOTP code or recovery code.",
|
|
99
|
+
"system.settings.mfa_disable_action": "Disable",
|
|
100
|
+
"system.settings.mfa_disable_success": "Multi-factor authentication disabled",
|
|
101
|
+
"system.settings.mfa_copy_uri": "Copy binding address",
|
|
102
|
+
"system.settings.mfa_copy_success": "Copied",
|
|
103
|
+
"system.notification.title": "Message Center",
|
|
104
|
+
"system.notification.description": "View system notifications and business messages",
|
|
105
|
+
"system.notification.empty": "No messages",
|
|
106
|
+
"system.notification.action.view_all": "View all",
|
|
107
|
+
"system.notification.view.inbox": "All",
|
|
108
|
+
"system.notification.view.unread": "Unread",
|
|
109
|
+
"system.notification.view.archived": "Archived",
|
|
110
|
+
"system.notification.category_filter": "Category ID",
|
|
111
|
+
"system.notification.mark_all_read": "Mark all read",
|
|
112
|
+
"system.notification.action.archive": "Archive",
|
|
113
|
+
"system.notification.action.restore": "Restore",
|
|
114
|
+
"system.notification.action.delete": "Delete"
|
|
91
115
|
}
|
package/src/locales/ja-JP.json
CHANGED
|
@@ -87,5 +87,29 @@
|
|
|
87
87
|
"system.settings.go_ask": "質問してみよう",
|
|
88
88
|
"system.settings.logout_confirm": "ログアウトしますか?",
|
|
89
89
|
"system.settings.logout_failed": "ログアウトに失敗しました",
|
|
90
|
-
"system.settings.title": "設定"
|
|
90
|
+
"system.settings.title": "設定",
|
|
91
|
+
"system.settings.mfa_title": "多要素認証",
|
|
92
|
+
"system.settings.mfa_enabled_method": "有効({method})",
|
|
93
|
+
"system.settings.mfa_disabled": "未設定",
|
|
94
|
+
"system.settings.mfa_method_totp": "TOTP",
|
|
95
|
+
"system.settings.mfa_method_webauthn": "WebAuthn",
|
|
96
|
+
"system.settings.mfa_bind_success": "多要素認証を有効にしました",
|
|
97
|
+
"system.settings.mfa_disable_title": "多要素認証を無効化",
|
|
98
|
+
"system.settings.mfa_disable_factor_required": "TOTP コードまたはリカバリーコードを入力してください。",
|
|
99
|
+
"system.settings.mfa_disable_action": "無効にする",
|
|
100
|
+
"system.settings.mfa_disable_success": "多要素認証を無効にしました",
|
|
101
|
+
"system.settings.mfa_copy_uri": "登録アドレスをコピー",
|
|
102
|
+
"system.settings.mfa_copy_success": "コピーしました",
|
|
103
|
+
"system.notification.title": "メッセージセンター",
|
|
104
|
+
"system.notification.description": "システム通知と業務メッセージを確認",
|
|
105
|
+
"system.notification.empty": "メッセージはありません",
|
|
106
|
+
"system.notification.action.view_all": "すべて表示",
|
|
107
|
+
"system.notification.view.inbox": "すべて",
|
|
108
|
+
"system.notification.view.unread": "未読",
|
|
109
|
+
"system.notification.view.archived": "アーカイブ済み",
|
|
110
|
+
"system.notification.category_filter": "カテゴリID",
|
|
111
|
+
"system.notification.mark_all_read": "すべて既読",
|
|
112
|
+
"system.notification.action.archive": "アーカイブ",
|
|
113
|
+
"system.notification.action.restore": "復元",
|
|
114
|
+
"system.notification.action.delete": "削除"
|
|
91
115
|
}
|
package/src/locales/zh-CN.json
CHANGED
|
@@ -87,5 +87,29 @@
|
|
|
87
87
|
"system.settings.go_ask": "去提问",
|
|
88
88
|
"system.settings.logout_confirm": "是否退出登录?",
|
|
89
89
|
"system.settings.logout_failed": "退出登录失败",
|
|
90
|
-
"system.settings.title": "设置"
|
|
90
|
+
"system.settings.title": "设置",
|
|
91
|
+
"system.settings.mfa_title": "多因素认证",
|
|
92
|
+
"system.settings.mfa_enabled_method": "已启用({method})",
|
|
93
|
+
"system.settings.mfa_disabled": "未启用",
|
|
94
|
+
"system.settings.mfa_method_totp": "TOTP",
|
|
95
|
+
"system.settings.mfa_method_webauthn": "WebAuthn",
|
|
96
|
+
"system.settings.mfa_bind_success": "多因素认证绑定成功",
|
|
97
|
+
"system.settings.mfa_disable_title": "禁用多因素认证",
|
|
98
|
+
"system.settings.mfa_disable_factor_required": "请输入动态口令或恢复码。",
|
|
99
|
+
"system.settings.mfa_disable_action": "禁用",
|
|
100
|
+
"system.settings.mfa_disable_success": "多因素认证已禁用",
|
|
101
|
+
"system.settings.mfa_copy_uri": "复制绑定地址",
|
|
102
|
+
"system.settings.mfa_copy_success": "复制成功",
|
|
103
|
+
"system.notification.title": "消息中心",
|
|
104
|
+
"system.notification.description": "查看系统通知和业务消息",
|
|
105
|
+
"system.notification.empty": "暂无消息",
|
|
106
|
+
"system.notification.action.view_all": "查看全部",
|
|
107
|
+
"system.notification.view.inbox": "全部",
|
|
108
|
+
"system.notification.view.unread": "未读",
|
|
109
|
+
"system.notification.view.archived": "已归档",
|
|
110
|
+
"system.notification.category_filter": "分类 ID",
|
|
111
|
+
"system.notification.mark_all_read": "全部已读",
|
|
112
|
+
"system.notification.action.archive": "归档",
|
|
113
|
+
"system.notification.action.restore": "恢复",
|
|
114
|
+
"system.notification.action.delete": "删除"
|
|
91
115
|
}
|
package/src/locales/zh-TW.json
CHANGED
|
@@ -87,5 +87,29 @@
|
|
|
87
87
|
"system.settings.go_ask": "去提問",
|
|
88
88
|
"system.settings.logout_confirm": "是否退出登入?",
|
|
89
89
|
"system.settings.logout_failed": "退出登入失敗",
|
|
90
|
-
"system.settings.title": "設定"
|
|
90
|
+
"system.settings.title": "設定",
|
|
91
|
+
"system.settings.mfa_title": "多因素認證",
|
|
92
|
+
"system.settings.mfa_enabled_method": "已啟用({method})",
|
|
93
|
+
"system.settings.mfa_disabled": "未啟用",
|
|
94
|
+
"system.settings.mfa_method_totp": "TOTP",
|
|
95
|
+
"system.settings.mfa_method_webauthn": "WebAuthn",
|
|
96
|
+
"system.settings.mfa_bind_success": "多因素認證綁定成功",
|
|
97
|
+
"system.settings.mfa_disable_title": "停用多因素認證",
|
|
98
|
+
"system.settings.mfa_disable_factor_required": "請輸入動態密碼或恢復碼。",
|
|
99
|
+
"system.settings.mfa_disable_action": "停用",
|
|
100
|
+
"system.settings.mfa_disable_success": "多因素認證已停用",
|
|
101
|
+
"system.settings.mfa_copy_uri": "複製綁定地址",
|
|
102
|
+
"system.settings.mfa_copy_success": "複製成功",
|
|
103
|
+
"system.notification.title": "消息中心",
|
|
104
|
+
"system.notification.description": "查看系統通知和業務消息",
|
|
105
|
+
"system.notification.empty": "暫無消息",
|
|
106
|
+
"system.notification.action.view_all": "查看全部",
|
|
107
|
+
"system.notification.view.inbox": "全部",
|
|
108
|
+
"system.notification.view.unread": "未讀",
|
|
109
|
+
"system.notification.view.archived": "已歸檔",
|
|
110
|
+
"system.notification.category_filter": "分類 ID",
|
|
111
|
+
"system.notification.mark_all_read": "全部已讀",
|
|
112
|
+
"system.notification.action.archive": "歸檔",
|
|
113
|
+
"system.notification.action.restore": "恢復",
|
|
114
|
+
"system.notification.action.delete": "刪除"
|
|
91
115
|
}
|
package/src/module.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineKratosTaroModule } from '@liujitcn/kratos-taro-app-core/module'
|
|
2
|
+
import { systemPages } from './pages'
|
|
3
|
+
import { LOCALE_MESSAGES } from './locales/generated'
|
|
4
|
+
|
|
5
|
+
/** Taro system 业务模块,声明页面、视图和语言资源。 */
|
|
6
|
+
export const systemModule = defineKratosTaroModule({
|
|
7
|
+
name: '@liujitcn/kratos-taro-app-system',
|
|
8
|
+
pages: systemPages,
|
|
9
|
+
views: {
|
|
10
|
+
PROFILE_HOME: 'pages/my/my',
|
|
11
|
+
PROFILE: 'pagesMember/profile/profile',
|
|
12
|
+
SETTINGS: 'pagesMember/settings/settings',
|
|
13
|
+
AI: 'pagesMember/ai/index',
|
|
14
|
+
MESSAGE_INBOX: 'pagesMember/message/index',
|
|
15
|
+
MESSAGE_DETAIL: 'pagesMember/message/detail',
|
|
16
|
+
},
|
|
17
|
+
messages: LOCALE_MESSAGES,
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
export default systemModule
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { setAppMenuBadge } from '@liujitcn/kratos-taro-app-core/navigation'
|
|
2
|
+
import { getRequestAccessToken } from '@liujitcn/kratos-taro-app-core/utils/http'
|
|
3
|
+
import { defNotificationService } from './api/base/notification'
|
|
4
|
+
|
|
5
|
+
/** System 模块共享的站内信未读数。 */
|
|
6
|
+
let unreadTotal = 0
|
|
7
|
+
let notificationTimer: ReturnType<typeof setInterval> | undefined
|
|
8
|
+
let stopNotificationSse: (() => void) | undefined
|
|
9
|
+
let notificationPaused = false
|
|
10
|
+
|
|
11
|
+
/** 从服务端刷新未读汇总并同步消息入口 badge。 */
|
|
12
|
+
export async function refreshNotificationSummary(): Promise<number> {
|
|
13
|
+
try {
|
|
14
|
+
const summary = await defNotificationService.GetNotificationSummary({})
|
|
15
|
+
unreadTotal = summary.unread_total
|
|
16
|
+
setAppMenuBadge('MESSAGE_INBOX', summary.unread_total)
|
|
17
|
+
} catch {
|
|
18
|
+
// 登录失效或网络不可用时保留上次 badge,后续生命周期事件会再次回源。
|
|
19
|
+
}
|
|
20
|
+
return unreadTotal
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** 启动应用端站内信定时回源。 */
|
|
24
|
+
export function startNotificationPolling(): void {
|
|
25
|
+
stopNotificationPolling()
|
|
26
|
+
notificationPaused = false
|
|
27
|
+
void refreshNotificationSummary()
|
|
28
|
+
notificationTimer = setInterval(() => void refreshNotificationSummary(), 30_000)
|
|
29
|
+
if (typeof window !== 'undefined' && typeof fetch !== 'undefined')
|
|
30
|
+
stopNotificationSse = startNotificationSse()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** 停止应用端站内信定时回源并清理 badge。 */
|
|
34
|
+
export function stopNotificationPolling(): void {
|
|
35
|
+
clearNotificationResources()
|
|
36
|
+
notificationPaused = false
|
|
37
|
+
unreadTotal = 0
|
|
38
|
+
setAppMenuBadge('MESSAGE_INBOX', 0)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** 暂停后台通知资源,保留当前 badge。 */
|
|
42
|
+
export function pauseNotificationPolling(): void {
|
|
43
|
+
notificationPaused = true
|
|
44
|
+
clearNotificationResources()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** 恢复前台通知资源并立即对账。 */
|
|
48
|
+
export function resumeNotificationPolling(): void {
|
|
49
|
+
if (!notificationPaused) return
|
|
50
|
+
notificationPaused = false
|
|
51
|
+
startNotificationPolling()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** 清理定时器与 SSE 连接。 */
|
|
55
|
+
function clearNotificationResources(): void {
|
|
56
|
+
if (notificationTimer) clearInterval(notificationTimer)
|
|
57
|
+
notificationTimer = undefined
|
|
58
|
+
stopNotificationSse?.()
|
|
59
|
+
stopNotificationSse = undefined
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** 在 H5 建立用户级通知 SSE,断线时由定时回源兜底。 */
|
|
63
|
+
function startNotificationSse(): () => void {
|
|
64
|
+
const controller = new AbortController()
|
|
65
|
+
void (async () => {
|
|
66
|
+
let retryDelay = 1_000
|
|
67
|
+
while (!controller.signal.aborted) {
|
|
68
|
+
try {
|
|
69
|
+
const token = await getRequestAccessToken()
|
|
70
|
+
if (!token || controller.signal.aborted) return
|
|
71
|
+
const response = await fetch(`${window.location.origin}/events?stream=base.notification`, {
|
|
72
|
+
headers: { Accept: 'text/event-stream', Authorization: token },
|
|
73
|
+
signal: controller.signal,
|
|
74
|
+
})
|
|
75
|
+
if (response.status === 401 || response.status === 403) return
|
|
76
|
+
if (!response.ok || !response.body) throw new Error('SSE connection failed')
|
|
77
|
+
retryDelay = 1_000
|
|
78
|
+
const reader = response.body.getReader()
|
|
79
|
+
const decoder = new TextDecoder()
|
|
80
|
+
let buffer = ''
|
|
81
|
+
while (!controller.signal.aborted) {
|
|
82
|
+
const chunk = await reader.read()
|
|
83
|
+
if (chunk.done) break
|
|
84
|
+
buffer += decoder.decode(chunk.value, { stream: true })
|
|
85
|
+
const events = buffer.split('\n\n')
|
|
86
|
+
buffer = events.pop() ?? ''
|
|
87
|
+
for (const event of events) {
|
|
88
|
+
if (event.includes('event: inbox.changed')) void refreshNotificationSummary()
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
} catch {
|
|
92
|
+
if (controller.signal.aborted) return
|
|
93
|
+
}
|
|
94
|
+
if (!controller.signal.aborted)
|
|
95
|
+
await new Promise((resolve) => setTimeout(resolve, retryDelay))
|
|
96
|
+
retryDelay = Math.min(retryDelay * 2, 30_000)
|
|
97
|
+
}
|
|
98
|
+
})()
|
|
99
|
+
return () => controller.abort()
|
|
100
|
+
}
|
package/src/pages.ts
CHANGED