Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit6ba05e4

Browse files
committed
chore(debug-online): only init preview custom scrollbar on non-mac
1 parent6300ed9 commit6ba05e4

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

‎containers/Preview/index.js‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
importReactfrom'react'
88

99
import{connectStore,buildLog}from'@utils'
10-
import{useShortcut}from'@hooks'
10+
import{useShortcut,usePlatform}from'@hooks'
1111

1212
importSliderPreviewfrom'./SliderPreview'
1313
importModalPreviewfrom'./ModalPreview'
1414
importViewerfrom'./Viewer'
1515

16-
import{useInit,closePreview}from'./logic'
16+
import{useInit,useScrollbar,closePreview}from'./logic'
1717

1818
/* eslint-disable-next-line */
1919
constlog=buildLog('C:Preview')
@@ -22,6 +22,9 @@ const PreviewContainer = ({ preview }) => {
2222
useInit(preview)
2323
useShortcut('esc',closePreview)
2424

25+
const{ isMacOS}=usePlatform()
26+
useScrollbar(isMacOS)
27+
2528
const{
2629
modalVisible,
2730
slideVisible,

‎containers/Preview/logic.js‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,20 @@ const DataResolver = [
8383
// ###############################
8484
// init & uninit
8585
// ###############################
86+
exportconstuseScrollbar=isMacOS=>{
87+
useEffect(()=>{
88+
if(isMacOS){
89+
/* eslint-disable no-undef */
90+
OverlayScrollbars(document.getElementById('preview-viewer-scroller'),{})
91+
}
92+
},[isMacOS])
93+
}
94+
8695
exportconstuseInit=_store=>{
8796
useEffect(()=>{
8897
store=_store
89-
9098
sub$=sr71$.data().subscribe($solver(DataResolver,[]))
9199

92-
/* eslint-disable no-undef */
93-
OverlayScrollbars(document.getElementById('preview-viewer-scroller'),{})
94-
95100
return()=>{
96101
if(!sub$)returnfalse
97102
sr71$.stop()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp