Fix some bugs

pull/37/head
Varun Patil 2022-08-17 20:59:26 +00:00
parent 4936a2fdf8
commit cb5487065e
4 changed files with 16 additions and 5 deletions

View File

@ -20,7 +20,7 @@
<navigations>
<navigation>
<name>Polaroid</name>
<route>polaroid.page.index</route>
<route>polaroid.page.main</route>
</navigation>
</navigations>
</info>

View File

@ -1,13 +1,15 @@
<?php
return [
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#index', 'url' => '/albums/{path}', 'verb' => 'GET', 'postfix' => 'albums',
['name' => 'page#main', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#album', 'url' => '/albusms/{path}/{path1}', 'verb' => 'GET',
'requirements' => [
'path' => '.*',
'path1' => '.*',
],
'defaults' => [
'path' => '',
'path1' => '',
]
],

View File

@ -29,7 +29,7 @@ class PageController extends Controller {
* @NoAdminRequired
* @NoCSRFRequired
*/
public function index() {
public function main() {
Util::addScript($this->appName, 'polaroid-main');
Util::addStyle($this->appName, 'icons');
@ -39,4 +39,11 @@ class PageController extends Controller {
return $response;
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function album() {
return $this->main();
}
}

View File

@ -413,6 +413,8 @@ export default {
try {
this.loading = true;
fileInfos = await dav.getFiles(ids);
} catch {
console.error('Failed to load fileInfos');
} finally {
this.loading = false;
}
@ -431,7 +433,7 @@ export default {
});
}
const photo = fileInfos.find(d => Number(d.fileid) === Number(img.id));
const photo = fileInfos.find(d => Number(d.fileid) === Number(img.file_id));
if (!photo) {
alert('Cannot find this photo anymore!');
return;