调整手机端弹窗通知规则
This commit is contained in:
@@ -16,15 +16,6 @@ function dismissToast(card) {
|
||||
window.setTimeout(() => card.remove(), 400);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前是否应在手机视口隐藏 Toast。
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
function shouldHideToastOnMobile() {
|
||||
return window.matchMedia?.("(max-width: 640px)")?.matches === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭容器内所有 Toast 卡片。
|
||||
*
|
||||
@@ -92,10 +83,6 @@ function createChatToast(container) {
|
||||
duration = 6000,
|
||||
action = null,
|
||||
}) {
|
||||
if (shouldHideToastOnMobile()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const card = document.createElement("div");
|
||||
card.className = "chat-toast-card";
|
||||
card.style.cssText = `
|
||||
|
||||
Reference in New Issue
Block a user