removed unneccesary Cryptoworker creations
This commit is contained in:
parent
6075949de7
commit
d5718b43e5
8 changed files with 15 additions and 31 deletions
|
@ -11,11 +11,7 @@ import { useRouter } from 'next/router';
|
|||
import * as Yup from 'yup';
|
||||
import { keyAttributes } from 'types';
|
||||
import { setKey, SESSION_KEYS, getKey } from 'utils/storage/sessionStorage';
|
||||
import * as Comlink from 'comlink';
|
||||
|
||||
const CryptoWorker: any =
|
||||
typeof window !== 'undefined' &&
|
||||
Comlink.wrap(new Worker('worker/crypto.worker.js', { type: 'module' }));
|
||||
import CryptoWorker from 'utils/crypto/cryptoWorker';
|
||||
|
||||
const Image = styled.img`
|
||||
width: 200px;
|
||||
|
|
|
@ -11,12 +11,8 @@ import { putAttributes } from 'services/userService';
|
|||
import { getData, LS_KEYS, setData } from 'utils/storage/localStorage';
|
||||
import { useRouter } from 'next/router';
|
||||
import { getKey, SESSION_KEYS, setKey } from 'utils/storage/sessionStorage';
|
||||
import * as Comlink from 'comlink';
|
||||
import { B64EncryptionResult } from 'services/uploadService';
|
||||
|
||||
const CryptoWorker: any =
|
||||
typeof window !== 'undefined' &&
|
||||
Comlink.wrap(new Worker('worker/crypto.worker.js', { type: 'module' }));
|
||||
import CryptoWorker from 'utils/crypto/cryptoWorker';
|
||||
|
||||
const Image = styled.img`
|
||||
width: 200px;
|
||||
|
|
|
@ -4,14 +4,11 @@ import { file } from './fileService';
|
|||
import localForage from 'localforage';
|
||||
|
||||
import HTTPService from './HTTPService';
|
||||
import * as Comlink from 'comlink';
|
||||
import { B64EncryptionResult } from './uploadService';
|
||||
import { getActualKey, getToken } from 'utils/common/key';
|
||||
import { user } from './userService';
|
||||
import CryptoWorker from 'utils/crypto/cryptoWorker';
|
||||
|
||||
const CryptoWorker: any =
|
||||
typeof window !== 'undefined' &&
|
||||
Comlink.wrap(new Worker('worker/crypto.worker.js', { type: 'module' }));
|
||||
const ENDPOINT = getEndpoint();
|
||||
|
||||
enum CollectionType {
|
||||
|
|
|
@ -2,13 +2,11 @@ import { getToken } from 'utils/common/key';
|
|||
import { file } from './fileService';
|
||||
import HTTPService from './HTTPService';
|
||||
import { getEndpoint } from 'utils/common/apiUtil';
|
||||
import * as Comlink from 'comlink';
|
||||
import { getFileExtension } from 'utils/common/utilFunctions';
|
||||
import CryptoWorker from 'utils/crypto/cryptoWorker';
|
||||
|
||||
const ENDPOINT = getEndpoint();
|
||||
const CryptoWorker: any =
|
||||
typeof window !== 'undefined' &&
|
||||
Comlink.wrap(new Worker('worker/crypto.worker.js', { type: 'module' }));
|
||||
|
||||
|
||||
const heic2any = typeof window !== 'undefined' && require('heic2any');
|
||||
const TYPE_HEIC = 'heic';
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
import { getEndpoint } from 'utils/common/apiUtil';
|
||||
import HTTPService from './HTTPService';
|
||||
import * as Comlink from 'comlink';
|
||||
import localForage from 'localforage';
|
||||
import { collection } from './collectionService';
|
||||
import { MetadataObject } from './uploadService';
|
||||
import CryptoWorker from 'utils/crypto/cryptoWorker';
|
||||
|
||||
const CryptoWorker: any =
|
||||
typeof window !== 'undefined' &&
|
||||
Comlink.wrap(new Worker('worker/crypto.worker.js', { type: 'module' }));
|
||||
const ENDPOINT = getEndpoint();
|
||||
const DIFF_LIMIT: number = 2500;
|
||||
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
import { getEndpoint } from 'utils/common/apiUtil';
|
||||
import HTTPService from './HTTPService';
|
||||
import * as Comlink from 'comlink';
|
||||
import EXIF from 'exif-js';
|
||||
import { fileAttribute } from './fileService';
|
||||
import { collection, CollectionAndItsLatestFile } from './collectionService';
|
||||
import { FILE_TYPE } from 'pages/gallery';
|
||||
import { checkConnectivity } from 'utils/common/utilFunctions';
|
||||
import { ErrorHandler } from 'utils/common/errorUtil';
|
||||
const CryptoWorker: any =
|
||||
typeof window !== 'undefined' &&
|
||||
Comlink.wrap(new Worker('worker/crypto.worker.js', { type: 'module' }));
|
||||
import CryptoWorker from 'utils/crypto/cryptoWorker';
|
||||
const ENDPOINT = getEndpoint();
|
||||
|
||||
const THUMBNAIL_HEIGHT = 720;
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
import CryptoWorker from 'utils/crypto/cryptoWorker';
|
||||
import { getData, LS_KEYS } from 'utils/storage/localStorage';
|
||||
import { getKey, SESSION_KEYS } from 'utils/storage/sessionStorage';
|
||||
import * as Comlink from 'comlink';
|
||||
|
||||
const CryptoWorker: any =
|
||||
typeof window !== 'undefined' &&
|
||||
Comlink.wrap(new Worker('worker/crypto.worker.js', { type: 'module' }));
|
||||
|
||||
export const getActualKey = async () => {
|
||||
const session = getData(LS_KEYS.SESSION);
|
||||
|
|
7
src/utils/crypto/cryptoWorker.ts
Normal file
7
src/utils/crypto/cryptoWorker.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import * as Comlink from 'comlink';
|
||||
|
||||
const CryptoWorker: any =
|
||||
typeof window !== 'undefined' &&
|
||||
Comlink.wrap(new Worker('worker/crypto.worker.js', { type: 'module' }));
|
||||
|
||||
export default CryptoWorker;
|
Loading…
Add table
Reference in a new issue