diff --git a/dist/linuxdo-scripts.user.js b/dist/linuxdo-scripts.user.js index c2812f4..339e093 100644 --- a/dist/linuxdo-scripts.user.js +++ b/dist/linuxdo-scripts.user.js @@ -201,7 +201,10 @@ methods: { init() { $(".topic-body .reply-to-tab[aria-expanded='false']").each(function() { - $(this).click(); + if (!$(this).data("clicked")) { + $(this).click(); + $(this).data("clicked", true); + } }); } }, diff --git a/linuxdo-scripts.user.js b/linuxdo-scripts.user.js index c2812f4..339e093 100644 --- a/linuxdo-scripts.user.js +++ b/linuxdo-scripts.user.js @@ -201,7 +201,10 @@ methods: { init() { $(".topic-body .reply-to-tab[aria-expanded='false']").each(function() { - $(this).click(); + if (!$(this).data("clicked")) { + $(this).click(); + $(this).data("clicked", true); + } }); } }, diff --git a/src/components/BasicSettings/MenuAutoexpandreply1.vue b/src/components/BasicSettings/MenuAutoexpandreply1.vue index c54a17e..ce3b4e1 100644 --- a/src/components/BasicSettings/MenuAutoexpandreply1.vue +++ b/src/components/BasicSettings/MenuAutoexpandreply1.vue @@ -15,14 +15,24 @@ export default { emits: ["update:modelValue"], methods: { init() { + // 遍历所有 aria-expanded 为 false 的按钮 $(".topic-body .reply-to-tab[aria-expanded='false']").each(function () { - $(this).click(); + // 检查按钮是否已经被点击过 + if (!$(this).data("clicked")) { + // 点击按钮 + $(this).click(); + + // 设置标识为已点击 + $(this).data("clicked", true); + } }); }, }, + created() { if (this.modelValue) { setInterval(() => { + // 检查是否存在按钮 if ($(".topic-body .reply-to-tab").length > 0) { this.init(); }