Refactor: Constantising log-mark

This commit is contained in:
vorotamoroz
2026-02-24 07:51:21 +00:00
parent 9f6a909143
commit 6eec8117f5
4 changed files with 8 additions and 6 deletions

View File

@@ -39,7 +39,7 @@ import {
isValidFilenameInDarwin,
isValidFilenameInWidows,
} from "@lib/string_and_binary/path.ts";
import { MARK_LOG_SEPARATOR } from "@lib/services/lib/logUtils.ts";
import { MARK_LOG_NETWORK_ERROR, MARK_LOG_SEPARATOR } from "@lib/services/lib/logUtils.ts";
import { NetworkWarningStyles } from "@lib/common/models/setting.const.ts";
// This module cannot be a core module because it depends on the Obsidian UI.
@@ -284,8 +284,8 @@ export class ModuleLog extends AbstractObsidianModule {
if (fileStatus && !this.settings.hideFileWarningNotice) messageLines.push(fileStatus);
const messages = (await this.services.appLifecycle.getUnresolvedMessages()).flat().filter((e) => e);
const stringMessages = messages.filter((m): m is string => typeof m === "string"); // for 'startsWith'
const networkMessages = stringMessages.filter((m) => m.startsWith("\u{200b}"));
const otherMessages = stringMessages.filter((m) => !m.startsWith("\u{200b}"));
const networkMessages = stringMessages.filter((m) => m.startsWith(MARK_LOG_NETWORK_ERROR));
const otherMessages = stringMessages.filter((m) => !m.startsWith(MARK_LOG_NETWORK_ERROR));
messageLines.push(...otherMessages);