mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-19 04:59:33 +01:00
remove import()
This commit is contained in:
@@ -117,7 +117,7 @@ const Input = ({
|
|||||||
break;
|
break;
|
||||||
case 'phonenumber':
|
case 'phonenumber':
|
||||||
// eslint-disable-next-line no-case-declarations
|
// eslint-disable-next-line no-case-declarations
|
||||||
const phone = await (await import('phone')).default;
|
const phone = require('phone').default;
|
||||||
// eslint-disable-next-line no-case-declarations
|
// eslint-disable-next-line no-case-declarations
|
||||||
let result = phone(value, {
|
let result = phone(value, {
|
||||||
strictDetection: true,
|
strictDetection: true,
|
||||||
|
|||||||
@@ -3,44 +3,49 @@ import filesystem from '../filesystem';
|
|||||||
import EventSource from '../sse/even-source-ios';
|
import EventSource from '../sse/even-source-ios';
|
||||||
import AndroidEventSource from '../sse/event-source';
|
import AndroidEventSource from '../sse/event-source';
|
||||||
import Storage from './storage';
|
import Storage from './storage';
|
||||||
|
import Database from 'notes-core/api/index';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {import("notes-core/api/index").default}
|
* @type {import("notes-core/api/index").default}
|
||||||
*/
|
*/
|
||||||
export var db;
|
export var db = new Database(
|
||||||
|
Storage,
|
||||||
|
Platform.OS === 'ios' ? EventSource : AndroidEventSource,
|
||||||
|
filesystem
|
||||||
|
);
|
||||||
|
|
||||||
|
db.host(
|
||||||
|
__DEV__
|
||||||
|
? {
|
||||||
|
API_HOST: 'https://api.notesnook.com',
|
||||||
|
AUTH_HOST: 'https://auth.streetwriters.co',
|
||||||
|
SSE_HOST: 'https://events.streetwriters.co',
|
||||||
|
SUBSCRIPTIONS_HOST: 'https://subscriptions.streetwriters.co',
|
||||||
|
ISSUES_HOST: 'https://issues.streetwriters.co'
|
||||||
|
// API_HOST: 'http://192.168.10.29:5264',
|
||||||
|
// AUTH_HOST: 'http://192.168.10.29:8264',
|
||||||
|
// SSE_HOST: 'http://192.168.10.29:7264',
|
||||||
|
// SUBSCRIPTIONS_HOST: 'http://192.168.10.29:9264',
|
||||||
|
// ISSUES_HOST: 'http://192.168.10.29:2624'
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
API_HOST: 'https://api.notesnook.com',
|
||||||
|
AUTH_HOST: 'https://auth.streetwriters.co',
|
||||||
|
SSE_HOST: 'https://events.streetwriters.co',
|
||||||
|
SUBSCRIPTIONS_HOST: 'https://subscriptions.streetwriters.co',
|
||||||
|
ISSUES_HOST: 'https://issues.streetwriters.co'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
let DB = null;
|
|
||||||
export async function loadDatabase() {
|
export async function loadDatabase() {
|
||||||
if (!DB) {
|
// if (!DB) {
|
||||||
let module = await import(/* webpackChunkName: "notes-core" */ 'notes-core/api/index');
|
// let module = await import(/* webpackChunkName: "notes-core" */ 'notes-core/api/index');
|
||||||
DB = module.default;
|
// DB = module.default;
|
||||||
}
|
// }
|
||||||
db = new DB(Storage, Platform.OS === 'ios' ? EventSource : AndroidEventSource, filesystem);
|
// db = new DB(Storage, Platform.OS === 'ios' ? EventSource : AndroidEventSource, filesystem);
|
||||||
//@ts-ignore
|
// //@ts-ignore
|
||||||
if (DOMParser) {
|
// if (DOMParser) {
|
||||||
//@ts-ignore
|
// //@ts-ignore
|
||||||
await DOMParser.prepare();
|
// await DOMParser.prepare();
|
||||||
}
|
// }
|
||||||
db.host(
|
|
||||||
__DEV__
|
|
||||||
? {
|
|
||||||
API_HOST: 'https://api.notesnook.com',
|
|
||||||
AUTH_HOST: 'https://auth.streetwriters.co',
|
|
||||||
SSE_HOST: 'https://events.streetwriters.co',
|
|
||||||
SUBSCRIPTIONS_HOST: 'https://subscriptions.streetwriters.co',
|
|
||||||
ISSUES_HOST: 'https://issues.streetwriters.co'
|
|
||||||
// API_HOST: 'http://192.168.10.29:5264',
|
|
||||||
// AUTH_HOST: 'http://192.168.10.29:8264',
|
|
||||||
// SSE_HOST: 'http://192.168.10.29:7264',
|
|
||||||
// SUBSCRIPTIONS_HOST: 'http://192.168.10.29:9264',
|
|
||||||
// ISSUES_HOST: 'http://192.168.10.29:2624'
|
|
||||||
}
|
|
||||||
: {
|
|
||||||
API_HOST: 'https://api.notesnook.com',
|
|
||||||
AUTH_HOST: 'https://auth.streetwriters.co',
|
|
||||||
SSE_HOST: 'https://events.streetwriters.co',
|
|
||||||
SUBSCRIPTIONS_HOST: 'https://subscriptions.streetwriters.co',
|
|
||||||
ISSUES_HOST: 'https://issues.streetwriters.co'
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export async function toTXT(note, notitle) {
|
|||||||
} else {
|
} else {
|
||||||
text = await db.notes.note(note.id).content();
|
text = await db.notes.note(note.id).content();
|
||||||
}
|
}
|
||||||
htmlToText = htmlToText || (await import('html-to-text'));
|
htmlToText = htmlToText || require('html-to-text');
|
||||||
text = htmlToText.convert(text, {
|
text = htmlToText.convert(text, {
|
||||||
selectors: [{ selector: 'img', format: 'skip' }]
|
selectors: [{ selector: 'img', format: 'skip' }]
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user