Skip to content

Commit

Permalink
🐛 修复脚本/订阅检查更新间隔无法设置的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Apr 30, 2022
1 parent 9144e3b commit 998c9f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { UserManager } from './apps/user/manager';
import { ToolsManager } from './apps/tools/manager';
import Dexie from 'dexie';
import { DBLogger } from './apps/logger/dblogger';
import { createLogger } from './apps/logger/logger';
import { ConsoleTransports } from './apps/logger/console';

migrate();

Expand All @@ -24,6 +26,14 @@ InitApp({
Environment: ENV_BACKGROUND,
});

const logger = createLogger({
catalog: {
name: 'background',
},
level: process.env.NODE_ENV === 'development' ? 'debug' : 'info',
transports: [new ConsoleTransports()],
});

void SystemConfig.init();

chrome.contextMenus.create({
Expand Down Expand Up @@ -84,6 +94,7 @@ function sandboxLoad(event: MessageEvent<{ action: string }>) {

// 检查更新
setInterval(() => {
logger.debug(`check_script_update_cycle ${SystemConfig.check_script_update_cycle}`);
if (SystemConfig.check_script_update_cycle === 0) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/Option/tabs/Config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class Config extends Vue {
{ key: 604800, val: '每周' },
],
change(val: any) {
SystemConfig.check_script_update_cycle = val.value.key;
SystemConfig.check_script_update_cycle = val.value;
},
},
{
Expand Down

0 comments on commit 998c9f9

Please sign in to comment.