Move more logic into sync-client
This commit is contained in:
parent
3f089bd37e
commit
9177984ff6
20 changed files with 68 additions and 143 deletions
|
|
@ -11,10 +11,15 @@ import { HistoryView } from "./views/history/history-view";
|
|||
import { StatusBar } from "./views/status-bar/status-bar";
|
||||
import { LogsView } from "./views/logs/logs-view";
|
||||
import { StatusDescription } from "./views/status-description/status-description";
|
||||
import { SyncClient, rateLimit, DEFAULT_SETTINGS, Logger } from "sync-client";
|
||||
import {
|
||||
SyncClient,
|
||||
rateLimit,
|
||||
DEFAULT_SETTINGS,
|
||||
Logger,
|
||||
debugging
|
||||
} from "sync-client";
|
||||
import { ObsidianFileSystemOperations } from "./obsidian-file-system";
|
||||
import { SyncSettingsTab } from "./views/settings/settings-tab";
|
||||
import { logToConsole } from "./utils/log-to-console";
|
||||
import { EditorStatusDisplayManager } from "./views/editor-status-display-manager/editor-status-display-manager";
|
||||
import { remoteCursorsTheme } from "./views/cursors/remote-cursor-theme";
|
||||
import {
|
||||
|
|
@ -22,8 +27,6 @@ import {
|
|||
RemoteCursorsPluginValue
|
||||
} from "./views/cursors/remote-cursors-plugin";
|
||||
import { LocalCursorUpdateListener } from "./views/cursors/local-cursor-update-listener";
|
||||
import { slowFetchFactory } from "./debugging/slow-fetch-factory";
|
||||
import { flakyWebSocketFactory } from "./debugging/flaky-websocket-factory";
|
||||
import { renderCursorsInFileExplorer } from "./views/cursors/file-explorer";
|
||||
|
||||
const MIN_WAIT_BETWEEN_UPDATES_IN_MS = 250;
|
||||
|
|
@ -49,8 +52,8 @@ export default class VaultLinkPlugin extends Plugin {
|
|||
|
||||
const debugOptions = isDebugBuild
|
||||
? {
|
||||
fetch: slowFetchFactory(1),
|
||||
webSocket: flakyWebSocketFactory(1, new Logger())
|
||||
fetch: debugging.slowFetchFactory(1),
|
||||
webSocket: debugging.slowWebSocketFactory(1, new Logger())
|
||||
}
|
||||
: {};
|
||||
|
||||
|
|
@ -67,7 +70,9 @@ export default class VaultLinkPlugin extends Plugin {
|
|||
...debugOptions
|
||||
});
|
||||
|
||||
logToConsole(this.client);
|
||||
if (isDebugBuild) {
|
||||
debugging.logToConsole(this.client);
|
||||
}
|
||||
|
||||
const statusDescription = new StatusDescription(this.client);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue