Skip to content

Commit

Permalink
fix: Do not load editor on unrelated pages
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Jan 15, 2024
1 parent 8a9ad39 commit beacfdb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Listeners/BeforeTemplateRenderedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace OCA\Collectives\Listeners;

use OCA\Collectives\AppInfo\Application;
use OCA\Collectives\Fs\UserFolderHelper;
use OCA\Collectives\Service\NotPermittedException;
use OCA\Text\Event\LoadEditor;
Expand Down Expand Up @@ -61,7 +62,8 @@ public function handle(Event $event): void {

Util::addScript('collectives', 'collectives-files');

if (class_exists(LoadEditor::class)) {
$isCollectivesResponse = $event->getResponse()->getApp() === Application::APP_NAME;
if ($isCollectivesResponse && class_exists(LoadEditor::class)) {
$this->eventDispatcher->dispatchTyped(new LoadEditor());
}

Expand Down
4 changes: 4 additions & 0 deletions tests/stub.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -855,3 +855,7 @@ namespace OCA\Files_Trashbin\Trash {
namespace OCP\Files\Mount {
interface ISystemMountPoint {}
}

namespace OCA\Text\Event {
class LoadEditor extends \OCP\EventDispatcher\Event {}
}

0 comments on commit beacfdb

Please sign in to comment.