修复可能导致收件失败问题回退优化自动刷新
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
NODE_ENV = 'eo'
|
||||
VITE_APP_TITLE = 'eo环境'
|
||||
VITE_BASE_URL = ''
|
||||
VITE_PWA_NAME = 'Cloud Mail'
|
||||
@@ -102,7 +102,6 @@ import {Icon} from "@iconify/vue";
|
||||
import router from "@/router/index.js";
|
||||
import {useI18n} from 'vue-i18n';
|
||||
import {toUtc} from "@/utils/day.js";
|
||||
import {AutoRefreshEnum} from "@/enums/setting-enum.js";
|
||||
import {sleep} from "@/utils/time-utils.js";
|
||||
import {useSettingStore} from "@/store/setting.js";
|
||||
import { useRoute } from 'vue-router'
|
||||
@@ -297,11 +296,13 @@ async function latest() {
|
||||
|
||||
while (true) {
|
||||
|
||||
await sleep(1000)
|
||||
let autoRefresh = settingStore.settings.autoRefresh;
|
||||
|
||||
await sleep(autoRefresh > 1 ? autoRefresh * 1000 : 3000);
|
||||
|
||||
const latestId = sysEmailScroll.value.latestEmail?.emailId
|
||||
|
||||
if (settingStore.settings.autoRefresh === AutoRefreshEnum.DISABLED) {
|
||||
if (autoRefresh < 2) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -345,7 +346,7 @@ async function latest() {
|
||||
|
||||
} catch (e) {
|
||||
if (e.code === 401 || e.code === 403) {
|
||||
settingStore.settings.autoRefresh = AutoRefreshEnum.DISABLED;
|
||||
settingStore.settings.autoRefresh = 0;
|
||||
}
|
||||
console.error(e)
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ import {sleep} from "@/utils/time-utils.js";
|
||||
import router from "@/router/index.js";
|
||||
import {Icon} from "@iconify/vue";
|
||||
import { useRoute } from 'vue-router'
|
||||
import {AutoRefreshEnum} from "@/enums/setting-enum.js";
|
||||
|
||||
defineOptions({
|
||||
name: 'email'
|
||||
@@ -78,7 +77,8 @@ const existIds = new Set();
|
||||
async function latest() {
|
||||
while (true) {
|
||||
|
||||
await sleep(1000)
|
||||
let autoRefresh = settingStore.settings.autoRefresh;
|
||||
await sleep(autoRefresh > 1 ? autoRefresh * 1000 : 3000);
|
||||
|
||||
if (route.name !== 'email') {
|
||||
continue;
|
||||
@@ -86,7 +86,7 @@ async function latest() {
|
||||
|
||||
const latestId = scroll.value.latestEmail?.emailId
|
||||
|
||||
if (!scroll.value.firstLoad && settingStore.settings.autoRefresh === AutoRefreshEnum.ENABLED) {
|
||||
if (!scroll.value.firstLoad && autoRefresh > 1) {
|
||||
try {
|
||||
const accountId = accountStore.currentAccountId
|
||||
const allReceive = scroll.value.latestEmail?.allReceive
|
||||
@@ -122,7 +122,7 @@ async function latest() {
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.code === 401 || e.code === 403) {
|
||||
settingStore.settings.autoRefresh = AutoRefreshEnum.DISABLED;
|
||||
settingStore.settings.autoRefresh = 0;
|
||||
}
|
||||
console.error(e)
|
||||
}
|
||||
|
||||
@@ -829,7 +829,11 @@ const regKeyOptions = computed(() => [
|
||||
|
||||
const authRefreshOptions = computed(() => [
|
||||
{label: t('disable'), value: 0},
|
||||
{label: t('enable'), value: 1},
|
||||
{label: '3s', value: 3},
|
||||
{label: '5s', value: 5},
|
||||
{label: '10s', value: 10},
|
||||
{label: '15s', value: 15},
|
||||
{label: '20s', value: 20},
|
||||
])
|
||||
|
||||
const tgChatId = ref([])
|
||||
|
||||
Reference in New Issue
Block a user