Skip to content

Commit

Permalink
Merge pull request #1165 from internxt/refactor/remove-legacy-code
Browse files Browse the repository at this point in the history
[_]: refactor/remove-legacy-code
  • Loading branch information
sg-gs authored Jun 25, 2024
2 parents 8db2ccf + 76b9f76 commit 9093844
Show file tree
Hide file tree
Showing 45 changed files with 13 additions and 2,579 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ REACT_APP_STORJ_BRIDGE=
REACT_APP_STRIPE_PK=
REACT_APP_STRIPE_TEST_PK=
REACT_APP_API_URL=
REACT_APP_PHOTOS_API_URL=
REACT_APP_PAYMENTS_API_URL=
GENERATE_SOURCEMAP=
REACT_APP_MAGIC_IV=
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/cd-to-share.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
- run: echo REACT_APP_SENTRY_DSN=${{ secrets.REACT_APP_SENTRY_DSN }} >> ./infrastructure/share/share.env
- run: echo REACT_APP_STORJ_BRIDGE=${{ secrets.REACT_APP_STORJ_BRIDGE }} >> ./infrastructure/share/share.env
- run: echo REACT_APP_HOSTNAME=${{ secrets.REACT_APP_HOSTNAME }} >> ./infrastructure/share/share.env
- run: echo REACT_APP_PHOTOS_API_URL=${{ secrets.REACT_APP_PHOTOS_API_URL }} >> ./infrastructure/share/share.env
- run: echo REACT_APP_PAYMENTS_API_URL=${{ secrets.REACT_APP_PAYMENTS_API_URL }} >> ./infrastructure/share/share.env
- run: echo REACT_APP_DRIVE_NEW_API_URL=${{ secrets.REACT_APP_DRIVE_NEW_API_URL }} >> ./infrastructure/share/share.env
- run: echo REACT_APP_RECAPTCHA_V3=${{ secrets.REACT_APP_RECAPTCHA_V3 }} >> ./infrastructure/share/share.env
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/cd-to-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
- run: echo REACT_APP_STORJ_BRIDGE=${{ secrets.REACT_APP_STORJ_BRIDGE }} >> ./infrastructure/staging/staging.env
- run: echo REACT_APP_HOSTNAME=${{ secrets.REACT_APP_HOSTNAME }} >> ./infrastructure/staging/staging.env
- run: echo REACT_APP_PROXY=${{ secrets.REACT_APP_PROXY }} >> ./infrastructure/staging/staging.env
- run: echo REACT_APP_PHOTOS_API_URL=${{ secrets.REACT_APP_PHOTOS_API_URL }} >> ./infrastructure/staging/staging.env
- run: echo REACT_APP_SENTRY_DSN=${{ secrets.REACT_APP_SENTRY_DSN }} >> ./infrastructure/staging/staging.env
- run: echo REACT_APP_PAYMENTS_API_URL=${{ secrets.REACT_APP_PAYMENTS_API_URL }} >> ./infrastructure/staging/staging.env
- run: echo REACT_APP_DRIVE_NEW_API_URL=${{ secrets.REACT_APP_DRIVE_NEW_API_URL }} >> ./infrastructure/staging/staging.env
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
- run: echo REACT_APP_HOSTNAME=${{ secrets.REACT_APP_HOSTNAME }} >> ./.env
- run: echo REACT_APP_PROXY=${{ secrets.REACT_APP_PROXY }} >> ./.env
- run: echo REACT_APP_DONT_USE_PROXY=${{ secrets.REACT_APP_DONT_USE_PROXY }} >> ./.env
- run: echo REACT_APP_PHOTOS_API_URL=${{ secrets.REACT_APP_PHOTOS_API_URL }} >> ./.env
- run: echo REACT_APP_SENTRY_DSN=${{ secrets.REACT_APP_SENTRY_DSN }} >> ./.env
- run: echo REACT_APP_PAYMENTS_API_URL=${{ secrets.REACT_APP_PAYMENTS_API_URL }} >> ./.env
- run: echo REACT_APP_DRIVE_NEW_API_URL=${{ secrets.REACT_APP_DRIVE_NEW_API_URL }} >> ./.env
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Stand for privacy, switch to Internxt. Internxt's open-source cloud storage services, Internxt Drive, Photos, Send, and more, protect your right to privacy."
content="Stand for privacy, switch to Internxt. Internxt's open-source cloud storage services, Internxt Drive, Send, and more, protect your right to privacy."
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
Expand Down
4 changes: 0 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import RealtimeService from './app/core/services/socket.service';
import { AppViewConfig } from './app/core/types';
import { LRUFilesCacheManager } from './app/database/services/database.service/LRUFilesCacheManager';
import { LRUFilesPreviewCacheManager } from './app/database/services/database.service/LRUFilesPreviewCacheManager';
import { LRUPhotosCacheManager } from './app/database/services/database.service/LRUPhotosCacheManager';
import { LRUPhotosPreviewsCacheManager } from './app/database/services/database.service/LRUPhotosPreviewCacheManager';
import FileViewerWrapper from './app/drive/components/FileViewer/FileViewerWrapper';
import Mobile from './app/drive/views/MobileView/MobileView';
import NewsletterDialog from './app/newsletter/components/NewsletterDialog/NewsletterDialog';
Expand Down Expand Up @@ -101,8 +99,6 @@ const App = (props: AppProps): JSX.Element => {
try {
await LRUFilesCacheManager.getInstance();
await LRUFilesPreviewCacheManager.getInstance();
await LRUPhotosCacheManager.getInstance();
await LRUPhotosPreviewsCacheManager.getInstance();

await domainManager.fetchDomains();

Expand Down
14 changes: 0 additions & 14 deletions src/app/core/factory/sdk/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Auth, Token } from '@internxt/sdk/dist/auth';
import { Backups, Payments, Referrals, Share, Storage, Trash, Users } from '@internxt/sdk/dist/drive';
import { Photos } from '@internxt/sdk/dist/photos';
import { ApiSecurity, ApiUrl, AppDetails } from '@internxt/sdk/dist/shared';
import packageJson from '../../../../../package.json';
import authService from '../../../auth/services/auth.service';
Expand Down Expand Up @@ -130,19 +129,6 @@ export class SdkFactory {
return Backups.client(apiUrl, appDetails, apiSecurity);
}

public async createPhotosClient(): Promise<Photos> {
if (!SdkFactory.sdk.localStorage.get('xToken')) {
return new Photos(process.env.REACT_APP_PHOTOS_API_URL);
}

let newToken = SdkFactory.sdk.localStorage.get('xNewToken');

if (!newToken) {
newToken = await authService.getNewToken();
SdkFactory.sdk.localStorage.set('xNewToken', newToken);
}
return new Photos(process.env.REACT_APP_PHOTOS_API_URL, newToken);
}
/** Helpers **/

private getApiSecurity(): ApiSecurity {
Expand Down
94 changes: 0 additions & 94 deletions src/app/core/services/zipFolder.service.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/app/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export enum AppView {
Backups = 'backups',
SharedLinks = 'shared-links',
Shared = 'shared',
Photos = 'photos',
Preferences = 'preferences',
DriveItems = 'drive-items',
FolderFileNotFound = 'folder-file-not-found',
Expand Down

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions src/app/database/services/database.service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export enum DatabaseProvider {
export enum DatabaseCollection {
Levels = 'levels',
MoveDialogLevels = 'move_levels',
Photos = 'photos',
LevelsBlobs = 'levels_blobs',
LRU_cache = 'lru_cache',
Account_settings = 'account_settings',
Expand All @@ -22,8 +21,6 @@ export enum DatabaseCollection {
export enum LRUCacheTypes {
LevelsBlobs = 'levels_blobs',
LevelsBlobsPreview = 'levels_blobs_preview',
PhotosPreview = 'photos_preview',
PhotosSource = 'photos_source',
}

export type DriveItemBlobData = {
Expand All @@ -34,11 +31,6 @@ export type DriveItemBlobData = {
updatedAt?: string;
};

export type PhotosData = {
preview?: Blob;
source?: Blob;
};

export type AvatarBlobData = {
srcURL: string;
avatarBlob: Blob;
Expand All @@ -65,11 +57,6 @@ export interface AppDatabase extends DBSchema {
key: LRUCacheTypes;
value: LRUCacheStruture;
};
photos: {
key: string;
value: PhotosData;
indexes?: Record<string, IDBValidKey>;
};
account_settings: {
key: string;
value: AvatarBlobData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const open = (name: string, version?: number): Promise<idb.IDBPDatabase<AppDatab
return idb.openDB<AppDatabase>(name, version, {
upgrade: (db, oldVersion) => {
if (oldVersion === 0) db.createObjectStore('levels');
if (oldVersion <= 1) db.createObjectStore('photos');
if (oldVersion <= 2) {
const objectStore = db.createObjectStore('levels_blobs');
objectStore.createIndex('parent_index' as never, 'parentId', { unique: false });
Expand Down
5 changes: 1 addition & 4 deletions src/app/database/services/database.service/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ const folderThreeBlobItems: DriveItemBlobData[] = [
];
const levels_blobs = { 1: [...folderBlobItems], 2: [...folderTwoBlobItems], 34: [...folderThreeBlobItems] };

const photos = { id1: { source: {} }, id2: { source: {} } };

const database = {
[DatabaseCollection.Levels]: { ...levels_blobs },
[DatabaseCollection.LevelsBlobs]: { ...levels_blobs },
[DatabaseCollection.Photos]: { ...photos },
};

export { folderBlobItems, folderTwoBlobItems, folderThreeBlobItems, levels_blobs, photos, database };
export { folderBlobItems, folderTwoBlobItems, folderThreeBlobItems, levels_blobs, database };
Loading

0 comments on commit 9093844

Please sign in to comment.