fix
This commit is contained in:
@@ -107,8 +107,13 @@ const handleNotificationToggle = async (checked) => {
|
||||
return
|
||||
}
|
||||
|
||||
const { data: { publicKey } } = await getVapidPublicKey()
|
||||
const convertedVapidKey = urlBase64ToUint8Array(publicKey)
|
||||
let { success, data, message } = await getVapidPublicKey()
|
||||
|
||||
if (!success) {
|
||||
throw new Error(message || '获取 VAPID 公钥失败')
|
||||
}
|
||||
|
||||
const convertedVapidKey = urlBase64ToUint8Array(data)
|
||||
|
||||
const subscription = await registration.pushManager.subscribe({
|
||||
userVisibleOnly: true,
|
||||
|
||||
Reference in New Issue
Block a user