Skip to content

Commit

Permalink
Merge pull request #4244 from nextcloud/removeUnusedStyle
Browse files Browse the repository at this point in the history
fix: remove unused style
  • Loading branch information
SebastianKrupinski authored Dec 5, 2024
2 parents 954dc6f + eca822f commit 5ef53c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 51 deletions.
53 changes: 11 additions & 42 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use OCA\Contacts\Service\GroupSharingService;
use OCA\Contacts\Service\SocialApiService;
use OCP\App\IAppManager;

use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
Expand All @@ -22,48 +21,19 @@
use OCP\Util;

class PageController extends Controller {
/** @var IConfig */
private $config;

/** @var IInitialStateService */
private $initialStateService;

/** @var IFactory */
private $languageFactory;

/** @var IUserSession */
private $userSession;

/** @var SocialApiService */
private $socialApiService;

/** @var IAppManager */
private $appManager;

/** @var CompareVersion */
private $compareVersion;

private GroupSharingService $groupSharingService;

public function __construct(IRequest $request,
IConfig $config,
IInitialStateService $initialStateService,
IFactory $languageFactory,
IUserSession $userSession,
SocialApiService $socialApiService,
IAppManager $appManager,
CompareVersion $compareVersion,
GroupSharingService $groupSharingService) {
public function __construct(
IRequest $request,
private IConfig $config,
private IInitialStateService $initialStateService,
private IFactory $languageFactory,
private IUserSession $userSession,
private SocialApiService $socialApiService,
private IAppManager $appManager,
private CompareVersion $compareVersion,
private GroupSharingService $groupSharingService,
) {
parent::__construct(Application::APP_ID, $request);

$this->config = $config;
$this->initialStateService = $initialStateService;
$this->languageFactory = $languageFactory;
$this->userSession = $userSession;
$this->socialApiService = $socialApiService;
$this->appManager = $appManager;
$this->compareVersion = $compareVersion;
$this->groupSharingService = $groupSharingService;
}

/**
Expand Down Expand Up @@ -107,7 +77,6 @@ public function index(): TemplateResponse {
$this->initialStateService->provideInitialState(Application::APP_ID, 'isCirclesEnabled', $isCirclesEnabled && $isCircleVersionCompatible);
$this->initialStateService->provideInitialState(Application::APP_ID, 'isTalkEnabled', $isTalkEnabled && $isTalkVersionCompatible);

Util::addStyle(Application::APP_ID, 'contacts-index');
Util::addStyle(Application::APP_ID, 'contacts-main');
Util::addScript(Application::APP_ID, 'contacts-main');

Expand Down
11 changes: 2 additions & 9 deletions lib/Listener/LoadContactsFilesActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@

class LoadContactsFilesActions implements IEventListener {
public function handle(Event $event): void {
if (!($event instanceof LoadAdditionalScriptsEvent)) {
if (!$event instanceof LoadAdditionalScriptsEvent) {
return;
}

Util::addStyle(Application::APP_ID, 'contacts-index');
Util::addStyle(Application::APP_ID, 'contacts-files-action');

// only available since Nc 28
if (method_exists(Util::class, 'addInitScript')) {
Util::addInitScript(Application::APP_ID, 'contacts-files-action');
} else {
Util::addScript(Application::APP_ID, 'contacts-files-action', 'files');
}
Util::addInitScript(Application::APP_ID, 'contacts-files-action');
}
}

0 comments on commit 5ef53c2

Please sign in to comment.