Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Jan 4, 2024
1 parent 4043d60 commit 7f800ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"prettier.enable": false,
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"files.associations": {
"*.css": "postcss"
Expand Down
7 changes: 4 additions & 3 deletions src/scroll/scrollToTop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ export function scrollToTop() {
const stop = useRaf(() => {
const t = document.documentElement.scrollTop || document.body.scrollTop
if (isUndef(pre)) pre = t
if ((pre < t && (pre * 8) / 7 !== t) || t === 0) stop()
if (t < 1) window.scrollTo(0, 0)
else window.scrollTo(0, (pre = (7 * t) / 8))
if ((pre < t && (pre * 8) / 7 !== t) || t === 0) {
stop()
window.scrollTo(0, 0)
} else window.scrollTo(0, (pre = (7 * t) / 8))
}, 0)
} catch (error: any) {
throw new Error(error)
Expand Down
1 change: 0 additions & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export default defineConfig({
name: 'tsup',
target: 'node14',
format: ['cjs', 'esm'],
minify: true,
splitting: false,
sourcemap: false,
clean: true,
Expand Down

0 comments on commit 7f800ae

Please sign in to comment.