2021-01-18 19:34:41 +01:00
|
|
|
import { IDBIndex, IDBStore } from "../idb";
|
|
|
|
|
2020-11-15 23:34:48 +01:00
|
|
|
export type UserAuth = number;
|
2020-10-02 22:33:32 +02:00
|
|
|
|
2020-12-23 02:18:07 +01:00
|
|
|
export const REPLIES_PEER_ID = 1271266957;
|
2020-10-02 22:33:32 +02:00
|
|
|
|
2020-04-26 14:19:17 +02:00
|
|
|
export const App = {
|
|
|
|
id: 1025907,
|
|
|
|
hash: '452b0359b988148995f22ff0f4229750',
|
2020-12-29 09:08:50 +01:00
|
|
|
version: '0.4.0',
|
2020-04-26 14:19:17 +02:00
|
|
|
domains: [] as string[],
|
2020-12-11 03:06:16 +01:00
|
|
|
baseDcId: 2
|
2020-04-26 14:19:17 +02:00
|
|
|
};
|
|
|
|
|
2021-02-03 23:38:19 +01:00
|
|
|
export const Modes = {
|
|
|
|
test: location.search.indexOf('test=1') > 0/* || true */,
|
|
|
|
debug: location.search.indexOf('debug=1') > 0,
|
|
|
|
http: false, //location.search.indexOf('http=1') > 0,
|
2021-02-04 01:30:23 +01:00
|
|
|
ssl: true, // location.search.indexOf('ssl=1') > 0 || location.protocol === 'https:' && location.search.indexOf('ssl=0') === -1,
|
2021-02-03 23:38:19 +01:00
|
|
|
multipleConnections: true
|
|
|
|
};
|
|
|
|
|
2021-01-18 19:34:41 +01:00
|
|
|
export type DatabaseStoreName = 'session' | 'stickerSets';
|
|
|
|
export type DatabaseStore = Omit<IDBStore, 'name'> & {name: DatabaseStoreName};
|
|
|
|
export const Database = {
|
2021-02-03 23:38:19 +01:00
|
|
|
name: 'tweb' + (Modes.test ? '_test' : ''),
|
2021-01-18 19:34:41 +01:00
|
|
|
version: 5,
|
|
|
|
stores: [{
|
|
|
|
name: 'session'
|
|
|
|
}, {
|
|
|
|
name: 'stickerSets'
|
|
|
|
}] as DatabaseStore[],
|
|
|
|
};
|
|
|
|
|
2021-02-03 23:38:19 +01:00
|
|
|
export const DEBUG = process.env.NODE_ENV !== 'production' || Modes.debug;
|
2020-12-11 03:06:16 +01:00
|
|
|
export const MOUNT_CLASS_TO: any = DEBUG ? (typeof(window) !== 'undefined' ? window : self) : null;
|