nx: remove base render

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/653/head
Varun Patil 2023-05-03 01:12:18 -07:00
parent 9903885862
commit 18e85006e7
1 changed files with 2 additions and 12 deletions

View File

@ -7,9 +7,7 @@ use OCA\Memories\Util;
use OCP\AppFramework\Controller; use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\ContentSecurityPolicy; use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\EventDispatcher\IEventDispatcher; use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IRequest; use OCP\IRequest;
use OCP\IUserSession; use OCP\IUserSession;
use OCP\Util as OCPUtil; use OCP\Util as OCPUtil;
@ -19,26 +17,20 @@ class PageController extends Controller
protected $userId; protected $userId;
protected $appName; protected $appName;
protected IEventDispatcher $eventDispatcher; protected IEventDispatcher $eventDispatcher;
private IInitialState $initialState;
private IUserSession $userSession; private IUserSession $userSession;
private IConfig $config;
public function __construct( public function __construct(
string $AppName, string $AppName,
IRequest $request, IRequest $request,
$UserId, $UserId,
IEventDispatcher $eventDispatcher, IEventDispatcher $eventDispatcher,
IInitialState $initialState, IUserSession $userSession
IUserSession $userSession,
IConfig $config
) { ) {
parent::__construct($AppName, $request); parent::__construct($AppName, $request);
$this->userId = $UserId; $this->userId = $UserId;
$this->appName = $AppName; $this->appName = $AppName;
$this->eventDispatcher = $eventDispatcher; $this->eventDispatcher = $eventDispatcher;
$this->initialState = $initialState;
$this->userSession = $userSession; $this->userSession = $userSession;
$this->config = $config;
} }
/** /**
@ -68,9 +60,7 @@ class PageController extends Controller
// Check if requested from native app // Check if requested from native app
$userAgent = $this->request->getHeader('User-Agent'); $userAgent = $this->request->getHeader('User-Agent');
if (strpos($userAgent, 'memories-native') !== false) { if (false === strpos($userAgent, 'memories-native')) {
$response->renderAs(TemplateResponse::RENDER_AS_BASE);
} else {
$this->eventDispatcher->dispatchTyped(new LoadSidebar()); $this->eventDispatcher->dispatchTyped(new LoadSidebar());
} }