Pass location search parameters to worker
This commit is contained in:
parent
e3c1366d8d
commit
5dfe2e5a45
@ -1,5 +1,6 @@
|
||||
import { blobConstruct } from '../helpers/blob';
|
||||
import FileManager from './filemanager';
|
||||
import { Modes } from './mtproto/mtproto_config';
|
||||
//import { MOUNT_CLASS_TO } from './mtproto/mtproto_config';
|
||||
//import { logger } from './polyfill';
|
||||
|
||||
@ -10,6 +11,10 @@ export default class CacheStorageController {
|
||||
//private log: ReturnType<typeof logger> = logger('CS');
|
||||
|
||||
constructor(public dbName: string) {
|
||||
if(Modes.test) {
|
||||
this.dbName += '_test';
|
||||
}
|
||||
|
||||
this.openDatabase();
|
||||
}
|
||||
|
||||
|
@ -12,18 +12,6 @@ export const App = {
|
||||
baseDcId: 2
|
||||
};
|
||||
|
||||
export type DatabaseStoreName = 'session' | 'stickerSets';
|
||||
export type DatabaseStore = Omit<IDBStore, 'name'> & {name: DatabaseStoreName};
|
||||
export const Database = {
|
||||
name: 'tweb',
|
||||
version: 5,
|
||||
stores: [{
|
||||
name: 'session'
|
||||
}, {
|
||||
name: 'stickerSets'
|
||||
}] as DatabaseStore[],
|
||||
};
|
||||
|
||||
export const Modes = {
|
||||
test: location.search.indexOf('test=1') > 0/* || true */,
|
||||
debug: location.search.indexOf('debug=1') > 0,
|
||||
@ -32,5 +20,17 @@ export const Modes = {
|
||||
multipleConnections: true
|
||||
};
|
||||
|
||||
export const DEBUG = process.env.NODE_ENV != 'production';
|
||||
export type DatabaseStoreName = 'session' | 'stickerSets';
|
||||
export type DatabaseStore = Omit<IDBStore, 'name'> & {name: DatabaseStoreName};
|
||||
export const Database = {
|
||||
name: 'tweb' + (Modes.test ? '_test' : ''),
|
||||
version: 5,
|
||||
stores: [{
|
||||
name: 'session'
|
||||
}, {
|
||||
name: 'stickerSets'
|
||||
}] as DatabaseStore[],
|
||||
};
|
||||
|
||||
export const DEBUG = process.env.NODE_ENV !== 'production' || Modes.debug;
|
||||
export const MOUNT_CLASS_TO: any = DEBUG ? (typeof(window) !== 'undefined' ? window : self) : null;
|
||||
|
Loading…
Reference in New Issue
Block a user