@@ -287,9 +287,15 @@ export default class Auth extends React.Component {
287287 save ( state , value ) {
288288 state == "pocket" && ( storage . secret . pocket . tags = value . trim ( ) ) ;
289289 state == "linnk" && ( storage . secret . linnk . group_name = value . trim ( ) ) ;
290- state == "notion" && ( storage . secret . notion . folder_id = value . trim ( ) ) ;
291- state == "notion" && ( storage . secret . notion . type = this . state . notion . filter ( item => item . value == value . trim ( ) ) [ 0 ] . type ) ;
292290 state == "youdao" && ( storage . secret . youdao . folder_id = value . trim ( ) ) ;
291+ state == "notion_save_image" && ( storage . secret . notion . save_image = value ) ;
292+ if ( state == 'notion' ) {
293+ const obj = this . state . notion . filter ( item => item . value == value . trim ( ) ) [ 0 ] ;
294+ storage . secret . notion . folder_id = value . trim ( ) ;
295+ storage . secret . notion . type = obj . type ;
296+ obj . schema && ( storage . secret . notion . schema = obj . schema ) ;
297+ obj . type == "page" && delete storage . secret . notion . schema ;
298+ }
293299 storage . Safe ( ( ) => this . setState ( { secret : storage . secret } ) , storage . secret ) ;
294300 }
295301
@@ -518,14 +524,20 @@ export default class Auth extends React.Component {
518524 onChange = { ( s ) => this . onChange ( "notion" , s ) } />
519525
520526 { this . state . secret . notion . access_token &&
521- < div style = { { display : "flex" , "flex-direction" : "row " , "justify-content" : "center" } } >
527+ < div style = { { display : "flex" , "flex-direction" : "column " , "justify-content" : "center" } } >
522528 { this . state . notion ? < Dropdown name = { "请选择保存的位置,默认为第一个" } items = { this . state . notion } width = "100%" onChange = { ( v , n ) => this . save ( "notion" , v ) } />
523529 : < Button type = "flat" width = "100%" style = { { "margin" : "0" } }
524530 text = "重新获取 Notion Page"
525531 color = "#fff" backgroundColor = "#3F51B5"
526532 waves = "md-waves-effect md-waves-button"
527533 onClick = { ( s ) => this . notionChange ( ) } /> }
528- </ div > }
534+
535+ < Switch width = "100%" checked = { this . state . secret . notion . save_image }
536+ thumbedColor = "#3F51B5" trackedColor = "#7986CB" waves = "md-waves-effect"
537+ label = "是否使用 Notion.so 作为图床?"
538+ desc = "由于 Notion 并未公开 API 所以此方式较慢。"
539+ onChange = { ( s ) => this . save ( "notion_save_image" , s ) } />
540+ </ div > }
529541 </ div >
530542 < div className = "version-tips" data-version = "1.1.4" data-hits = "youdao" >
531543 < Switch width = "100%" checked = { this . state . secret . youdao . access_token != "" ? true : false }
0 commit comments