mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
cleanup
This commit is contained in:
parent
53c8de3695
commit
168df15e53
@ -51,7 +51,6 @@ export class NavigationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async toGallery(): Promise<boolean> {
|
public async toGallery(): Promise<boolean> {
|
||||||
console.log('toGallery');
|
|
||||||
await this.shareService.wait();
|
await this.shareService.wait();
|
||||||
if (this.shareService.isSharing()) {
|
if (this.shareService.isSharing()) {
|
||||||
return this.router.navigate(['share', this.shareService.getSharingKey()]);
|
return this.router.navigate(['share', this.shareService.getSharingKey()]);
|
||||||
|
@ -1,24 +1,20 @@
|
|||||||
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
import {Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
|
||||||
import { AuthenticationService } from '../../model/network/authentication.service';
|
import {AuthenticationService} from '../../model/network/authentication.service';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
import {ActivatedRoute, Params, Router} from '@angular/router';
|
||||||
import {
|
import {ContentService, ContentWrapperWithError, DirectoryContent,} from './content.service';
|
||||||
ContentService,
|
import {GalleryGridComponent} from './grid/grid.gallery.component';
|
||||||
ContentWrapperWithError,
|
import {Config} from '../../../../common/config/public/Config';
|
||||||
DirectoryContent,
|
import {ShareService} from './share.service';
|
||||||
} from './content.service';
|
import {NavigationService} from '../../model/navigation.service';
|
||||||
import { GalleryGridComponent } from './grid/grid.gallery.component';
|
import {UserRoles} from '../../../../common/entities/UserDTO';
|
||||||
import { Config } from '../../../../common/config/public/Config';
|
import {interval, Observable, Subscription} from 'rxjs';
|
||||||
import { ShareService } from './share.service';
|
import {PageHelper} from '../../model/page.helper';
|
||||||
import { NavigationService } from '../../model/navigation.service';
|
import {PhotoDTO} from '../../../../common/entities/PhotoDTO';
|
||||||
import { UserRoles } from '../../../../common/entities/UserDTO';
|
import {QueryParams} from '../../../../common/QueryParams';
|
||||||
import { interval, Observable, Subscription } from 'rxjs';
|
import {take} from 'rxjs/operators';
|
||||||
import { PageHelper } from '../../model/page.helper';
|
import {GallerySortingService} from './navigator/sorting.service';
|
||||||
import { PhotoDTO } from '../../../../common/entities/PhotoDTO';
|
import {MediaDTO} from '../../../../common/entities/MediaDTO';
|
||||||
import { QueryParams } from '../../../../common/QueryParams';
|
import {FilterService} from './filter/filter.service';
|
||||||
import { take } from 'rxjs/operators';
|
|
||||||
import { GallerySortingService } from './navigator/sorting.service';
|
|
||||||
import { MediaDTO } from '../../../../common/entities/MediaDTO';
|
|
||||||
import { FilterService } from './filter/filter.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-gallery',
|
selector: 'app-gallery',
|
||||||
@ -26,7 +22,7 @@ import { FilterService } from './filter/filter.service';
|
|||||||
styleUrls: ['./gallery.component.css'],
|
styleUrls: ['./gallery.component.css'],
|
||||||
})
|
})
|
||||||
export class GalleryComponent implements OnInit, OnDestroy {
|
export class GalleryComponent implements OnInit, OnDestroy {
|
||||||
@ViewChild(GalleryGridComponent, { static: false })
|
@ViewChild(GalleryGridComponent, {static: false})
|
||||||
grid: GalleryGridComponent;
|
grid: GalleryGridComponent;
|
||||||
|
|
||||||
public showSearchBar = false;
|
public showSearchBar = false;
|
||||||
@ -78,9 +74,9 @@ export class GalleryComponent implements OnInit, OnDestroy {
|
|||||||
// if the timer is longer than 10 years, just do not show it
|
// if the timer is longer than 10 years, just do not show it
|
||||||
if (
|
if (
|
||||||
(this.shareService.sharingSubject.value.expires - Date.now()) /
|
(this.shareService.sharingSubject.value.expires - Date.now()) /
|
||||||
1000 /
|
1000 /
|
||||||
86400 /
|
86400 /
|
||||||
365 >
|
365 >
|
||||||
10
|
10
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
@ -147,11 +143,6 @@ export class GalleryComponent implements OnInit, OnDestroy {
|
|||||||
this.updateTimer(x)
|
this.updateTimer(x)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
this.subscription.sorting = this.galleryService.sorting.subscribe((): void => {
|
|
||||||
this.sortDirectories();
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private onRoute = async (params: Params): Promise<void> => {
|
private onRoute = async (params: Params): Promise<void> => {
|
||||||
@ -173,7 +164,7 @@ export class GalleryComponent implements OnInit, OnDestroy {
|
|||||||
qParams[QueryParams.gallery.sharingKey_query] =
|
qParams[QueryParams.gallery.sharingKey_query] =
|
||||||
this.shareService.getSharingKey();
|
this.shareService.getSharingKey();
|
||||||
this.router
|
this.router
|
||||||
.navigate(['/gallery', sharing.path], { queryParams: qParams })
|
.navigate(['/gallery', sharing.path], {queryParams: qParams})
|
||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user