3030use OCA \FirstRunWizard \Notification \AppHint ;
3131use OCP \AppFramework \Http \Events \BeforeTemplateRenderedEvent ;
3232use OCP \BackgroundJob \IJobList ;
33+ use OCP \Defaults ;
3334use OCP \EventDispatcher \Event ;
3435use OCP \EventDispatcher \IEventListener ;
3536use OCP \IConfig ;
37+ use OCP \AppFramework \Services \IInitialState ;
3638use OCP \IUser ;
3739use OCP \IUserSession ;
3840use OCP \Util ;
@@ -55,16 +57,26 @@ class BeforeTemplateRenderedListener implements IEventListener {
5557 */
5658 private $ jobList ;
5759
60+ /** @var IInitialState */
61+ protected $ initialState ;
62+
63+ /** @var Defaults */
64+ protected $ theming ;
65+
5866 public function __construct (
5967 IConfig $ config ,
6068 IUserSession $ userSession ,
6169 IJobList $ jobList ,
62- AppHint $ appHint
70+ AppHint $ appHint ,
71+ IInitialState $ initialState ,
72+ Defaults $ theming ,
6373 ) {
6474 $ this ->userSession = $ userSession ;
6575 $ this ->config = $ config ;
6676 $ this ->appHint = $ appHint ;
6777 $ this ->jobList = $ jobList ;
78+ $ this ->initialState = $ initialState ;
79+ $ this ->theming = $ theming ;
6880 }
6981
7082 public function handle (Event $ event ): void {
@@ -88,5 +100,20 @@ public function handle(Event $event): void {
88100 }
89101
90102 Util::addScript (Application::APP_ID , 'about ' );
103+
104+ $ this ->initialState ->provideInitialState (
105+ 'desktop ' ,
106+ $ this ->config ->getSystemValue ('customclient_desktop ' , $ this ->theming ->getSyncClientUrl ())
107+ );
108+
109+ $ this ->initialState ->provideInitialState (
110+ 'android ' ,
111+ $ this ->config ->getSystemValue ('customclient_android ' , $ this ->theming ->getAndroidClientUrl ())
112+ );
113+
114+ $ this ->initialState ->provideInitialState (
115+ 'ios ' ,
116+ $ this ->config ->getSystemValue ('customclient_ios ' , $ this ->theming ->getiOSClientUrl ())
117+ );
91118 }
92119}
0 commit comments