Skip to content

Commit

Permalink
style: remove unused code and fix incorrect naming style during renaming
Browse files Browse the repository at this point in the history
Signed-off-by: James Chien <james@numbersprotocol.io>
  • Loading branch information
shc261392 committed Apr 25, 2024
1 parent ddade79 commit 5eb8405
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 70 deletions.
1 change: 0 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ export class AppComponent {
'capture-rebrand-camera-crop',
'capture',
'profile',
'search',
'collection',
'edit',
'capture-rebrand-add',
Expand Down
34 changes: 0 additions & 34 deletions src/app/features/home/capture-tab/capture-tab.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,40 +113,6 @@ app-capture-item {
border-radius: 16px;
}

.post-captures {
overflow: auto;
padding: 32px 8px;

mat-grid-tile {
ion-img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
overflow: hidden;
border-radius: 16px;
}

ion-icon {
color: white;
z-index: 10;
position: absolute;
opacity: 0.3;
font-size: 16px;
}

ion-icon.is-video {
top: 8px;
right: 8px;
}

ion-icon.is-from-store {
top: 8px;
left: 8px;
}
}
}

mat-grid-list {
margin-left: 12px;
margin-right: 12px;
Expand Down
12 changes: 0 additions & 12 deletions src/app/features/home/capture-tab/capture-tab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ import {
concatMap,
concatMapTo,
map,
pluck,
shareReplay,
startWith,
switchMap,
tap,
} from 'rxjs/operators';
import { BlockingActionService } from '../../../shared/blocking-action/blocking-action.service';
Expand Down Expand Up @@ -100,16 +98,6 @@ export class CaptureTabComponent implements OnInit {

readonly networkConnected$ = this.networkService.connected$;

readonly postCaptures$ = this.networkConnected$.pipe(
switchMap(isConnected =>
iif(
() => isConnected,
this.diaBackendAssetRepository.postCaptures$.pipe(pluck('results'))
)
),
catchError((err: unknown) => this.errorService.toastError$(err))
);

private readonly itemsPerPage = 10;

readonly capturedTabPageIndex$ = new BehaviorSubject<number>(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { NetworkService } from '../../../../shared/network/network.service';
export class CollectionTabComponent {
readonly bubbleIframeUrlWithCachedJWTToke$ = combineLatest([
this.diaBackendAuthService.cachedQueryJWTToken$,
this.iframeService.CollectionTabRefreshRequested$,
this.iframeService.collectionTabRefreshRequested$,
]).pipe(
map(([token, _]) => {
const url = `${BUBBLE_IFRAME_URL}/collection?token=${token.access}&refresh_token=${token.refresh}`;
Expand All @@ -37,13 +37,15 @@ export class CollectionTabComponent {
private readonly iframeService: IframeService,
private readonly sanitizer: DomSanitizer
) {
iframeService.CollectionTabIframeNavigateBack$.pipe(
tap(_ => this.navigateBackcollectionIframe()),
untilDestroyed(this)
).subscribe();
iframeService.collectionTabIframeNavigateBack$
.pipe(
tap(_ => this.navigateBackCollectionIframe()),
untilDestroyed(this)
)
.subscribe();
}

navigateBackcollectionIframe() {
navigateBackCollectionIframe() {
this.collectionIframe?.nativeElement.contentWindow?.postMessage(
IonicToBubblePostMessage.ANDROID_BACK_BUTTON,
BUBBLE_IFRAME_URL
Expand Down
6 changes: 3 additions & 3 deletions src/app/features/home/home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import { PrefetchingDialogComponent } from './onboarding/prefetching-dialog/pref
export class HomePage {
readonly initialTabIndex = 0;
private readonly afterCaptureTabIndex = 0;
private readonly CollectionTabIndex = 2;
private readonly collectionTabIndex = 2;
selectedTabIndex = this.initialTabIndex;

readonly username$ = this.diaBackendAuthService.username$;
Expand Down Expand Up @@ -306,7 +306,7 @@ export class HomePage {
this.androidBackButtonService
.overrideAndroidBackButtonBehavior$(() => {
const shouldNavigateBackCollectionTabIframe =
this.selectedTabIndex === this.CollectionTabIndex &&
this.selectedTabIndex === this.collectionTabIndex &&
this.router.url === '/home';
if (shouldNavigateBackCollectionTabIframe) {
this.iframeService.navigateBackCollectionTabIframe();
Expand Down Expand Up @@ -425,7 +425,7 @@ export class HomePage {

// eslint-disable-next-line class-methods-use-this
async navigateToCollectionTab() {
if (this.selectedTabIndex === this.CollectionTabIndex) {
if (this.selectedTabIndex === this.collectionTabIndex) {
// window.location.reload();
this.iframeService.refreshCollectionTabIframe();
}
Expand Down
12 changes: 6 additions & 6 deletions src/app/shared/iframe/iframe.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ export class IframeService {

private readonly preferences = this.preferenceManager.getPreferences(this.id);

readonly CollectionTabRefreshRequested$ = new BehaviorSubject(new Date());
readonly collectionTabRefreshRequested$ = new BehaviorSubject(new Date());

private readonly _CollectionTabIframeNavigateBack$ =
private readonly _collectionTabIframeNavigateBack$ =
new ReplaySubject<boolean>(1);

readonly CollectionTabIframeNavigateBack$ =
this._CollectionTabIframeNavigateBack$.asObservable();
readonly collectionTabIframeNavigateBack$ =
this._collectionTabIframeNavigateBack$.asObservable();

readonly detailsPageIframeReloadRequested$ = this.preferences.getNumber$(
PrefKeys.DETAILS_PAGE_RELOAD_REQUESTED_TIMESTAMP,
Expand All @@ -26,11 +26,11 @@ export class IframeService {
constructor(private readonly preferenceManager: PreferenceManager) {}

refreshCollectionTabIframe() {
this.CollectionTabRefreshRequested$.next(new Date());
this.collectionTabRefreshRequested$.next(new Date());
}

navigateBackCollectionTabIframe() {
this._CollectionTabIframeNavigateBack$.next(true);
this._collectionTabIframeNavigateBack$.next(true);
}

refreshDetailsPageIframe() {
Expand Down
8 changes: 0 additions & 8 deletions src/assets/images/icons/search.svg

This file was deleted.

0 comments on commit 5eb8405

Please sign in to comment.