Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
🐛 Fix: support double click to top for all pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tjx666 committed Nov 24, 2019
1 parent da9f717 commit 6409af2
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 2 deletions.
Binary file added docs/autoClock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/blockPosts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/onlineStorage.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"blockWish": false, // 是否屏蔽许愿贴
"blockMakeFriends": false, // 是否屏蔽交友贴
"autoClock": false, // 是否开启自动打卡
"doubleClickBackToTop": false, // 是否开启双击返回顶部的功能
"feeling": "", // 打开内容
"lastClockDate": "", // 上次打卡日期
"autoClockFailed": false, // 自动打卡失败
Expand Down
1 change: 1 addition & 0 deletions src/background/autoClock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default function() {

const { code } = res.data;
if (code === 0) {
// eslint-disable-next-line prefer-template
notification('牛客网自动打卡成功!', `打卡内容:${feeling ? feeling + '!' : ''}`);
} else if (code === 999) {
// 999: 未登入
Expand Down
5 changes: 5 additions & 0 deletions src/contents/all/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { onlineStorage } from 'utils/storage';
import extensionAutoReload from './extensionAutoReload';
import doubleClickBackToTop from './doubleClickBackToTop';
import './style.scss';

// 存储 cookie
onlineStorage.set({ cookies: document.cookie });

// SSE client
process.env.NODE_ENV === 'development' && extensionAutoReload();

onlineStorage.get({ doubleClickBackToTop: false }).then(({ doubleClickBackToTop: doubleClickBackToTopSetting }) => {
doubleClickBackToTopSetting && doubleClickBackToTop();
});
2 changes: 0 additions & 2 deletions src/contents/discuss/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import blockPosts from './blockPosts';
import doubleClickBackToTop from './doubleClickBackToTop';
import './style.scss';

doubleClickBackToTop();
blockPosts();

0 comments on commit 6409af2

Please sign in to comment.