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 ;
@@ -31,16 +32,18 @@ public function __construct(IConfig $config, IInitialState $initialState, string
3132
3233 public function getForm (): TemplateResponse {
3334 $ defaultAcceptSystemConfig = $ this ->config ->getSystemValueBool ('sharing.enable_share_accept ' , false ) ? 'no ' : 'yes ' ;
34- $ shareFolderSystemConfig = $ this ->config ->getSystemValue ('share_folder ' , '/ ' );
35+ $ defaultShareFolder = $ this ->config ->getSystemValue ('share_folder ' , '/ ' );
36+ $ userShareFolder = Helper::getShareFolder (userId: $ this ->userId );
3537 $ acceptDefault = $ this ->config ->getUserValue ($ this ->userId , Application::APP_ID , 'default_accept ' , $ defaultAcceptSystemConfig ) === 'yes ' ;
3638 $ enforceAccept = $ this ->config ->getSystemValueBool ('sharing.force_share_accept ' , false );
3739 $ allowCustomDirectory = $ this ->config ->getSystemValueBool ('sharing.allow_custom_share_folder ' , true );
38- $ shareFolderDefault = $ this -> config -> getUserValue ( $ this -> userId , Application:: APP_ID , ' share_folder ' , $ shareFolderSystemConfig );
40+
3941 $ this ->initialState ->provideInitialState ('accept_default ' , $ acceptDefault );
4042 $ this ->initialState ->provideInitialState ('enforce_accept ' , $ enforceAccept );
4143 $ this ->initialState ->provideInitialState ('allow_custom_share_folder ' , $ allowCustomDirectory );
42- $ this ->initialState ->provideInitialState ('share_folder ' , $ shareFolderDefault );
43- $ this ->initialState ->provideInitialState ('default_share_folder ' , $ shareFolderSystemConfig );
44+ $ this ->initialState ->provideInitialState ('default_share_folder ' , $ defaultShareFolder );
45+ $ this ->initialState ->provideInitialState ('share_folder ' , $ userShareFolder );
46+
4447 return new TemplateResponse ('files_sharing ' , 'Settings/personal ' );
4548 }
4649
0 commit comments