nx: remove base render
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/653/head
parent
9903885862
commit
18e85006e7
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue