99namespace OCA \Files_Sharing \Settings ;
1010
1111use OCA \Files_Sharing \AppInfo \Application ;
12+ use OCA \Files_Sharing \Helper ;
1213use OCP \AppFramework \Http \TemplateResponse ;
1314use OCP \AppFramework \Services \IInitialState ;
1415use OCP \IConfig ;
@@ -25,16 +26,18 @@ public function __construct(
2526
2627 public function getForm (): TemplateResponse {
2728 $ defaultAcceptSystemConfig = $ this ->config ->getSystemValueBool ('sharing.enable_share_accept ' , false ) ? 'no ' : 'yes ' ;
28- $ shareFolderSystemConfig = $ this ->config ->getSystemValue ('share_folder ' , '/ ' );
29+ $ defaultShareFolder = $ this ->config ->getSystemValue ('share_folder ' , '/ ' );
30+ $ userShareFolder = Helper::getShareFolder (userId: $ this ->userId );
2931 $ acceptDefault = $ this ->config ->getUserValue ($ this ->userId , Application::APP_ID , 'default_accept ' , $ defaultAcceptSystemConfig ) === 'yes ' ;
3032 $ enforceAccept = $ this ->config ->getSystemValueBool ('sharing.force_share_accept ' , false );
3133 $ allowCustomDirectory = $ this ->config ->getSystemValueBool ('sharing.allow_custom_share_folder ' , true );
32- $ shareFolderDefault = $ this -> config -> getUserValue ( $ this -> userId , Application:: APP_ID , ' share_folder ' , $ shareFolderSystemConfig );
34+
3335 $ this ->initialState ->provideInitialState ('accept_default ' , $ acceptDefault );
3436 $ this ->initialState ->provideInitialState ('enforce_accept ' , $ enforceAccept );
3537 $ this ->initialState ->provideInitialState ('allow_custom_share_folder ' , $ allowCustomDirectory );
36- $ this ->initialState ->provideInitialState ('share_folder ' , $ shareFolderDefault );
37- $ this ->initialState ->provideInitialState ('default_share_folder ' , $ shareFolderSystemConfig );
38+ $ this ->initialState ->provideInitialState ('default_share_folder ' , $ defaultShareFolder );
39+ $ this ->initialState ->provideInitialState ('share_folder ' , $ userShareFolder );
40+
3841 return new TemplateResponse ('files_sharing ' , 'Settings/personal ' );
3942 }
4043
0 commit comments