diff --git a/server/distribute/import.js b/server/distribute/import.js index e6aac17d..3bdeefa1 100644 --- a/server/distribute/import.js +++ b/server/distribute/import.js @@ -17,8 +17,6 @@ const { disconnectedStr, tokenRejectedStr, authTryStr, - makeColor, - stringToRGB, getMessage, getDescription, logWraped, @@ -36,13 +34,6 @@ const wrapApply = (f, disconnect) => (status) => () => f(null, { const closeIfNot = wraptile((socket, is) => !is && socket.close()); const addUrl = currify((url, a) => `${url}: ${a}`); -const getColorUrl = (url, name) => { - if (!name) - return url; - - return makeColor(url, stringToRGB(name)); -}; - const rmListeners = wraptile((socket, listeners) => { socket.removeListener('connect', listeners.onConnect); socket.removeListener('config', listeners.onConfig); @@ -99,7 +90,7 @@ module.exports = (config, options, fn) => { }); const superFn = wrapApply(fn, socket.close.bind(socket)); - const colorUrl = getColorUrl(importUrl, name); + const colorUrl = importUrl; const close = closeIfNot(socket, importListen); const statusStore = fullstore(); diff --git a/server/distribute/log.js b/server/distribute/log.js index f08fc58c..6a37de50 100644 --- a/server/distribute/log.js +++ b/server/distribute/log.js @@ -6,9 +6,9 @@ const chalk = require('chalk'); const datetime = require('../../common/datetime'); const log = (isLog, name, msg) => isLog && console.log(`${datetime()} -> ${name}: ${msg}`); -const makeColor = (a, color) => chalk.rgb(color || stringToRGB(a))(a); +const makeColor = (a) => chalk.blue(a); const getMessage = (e) => e.message || e; -const getDescription = (e) => `${e.type}: ${e.description}`; +const getDescription = (e) => e.message; module.exports = log; module.exports.logWraped = wraptile(log); diff --git a/server/markdown/index.js b/server/markdown/index.js index 0906d57e..07dda525 100644 --- a/server/markdown/index.js +++ b/server/markdown/index.js @@ -1,6 +1,6 @@ 'use strict'; -const {readFile} = require('fs').promises; +const {readFile} = require('fs/promises'); const {join} = require('path'); const {callbackify} = require('util'); diff --git a/server/user-menu.js b/server/user-menu.js index 9e3878e7..9e803ded 100644 --- a/server/user-menu.js +++ b/server/user-menu.js @@ -1,7 +1,7 @@ 'use strict'; const {homedir} = require('os'); -const {readFile} = require('fs').promises; +const {readFile} = require('fs/promises'); const {join} = require('path');