feature(client) io: promisify -> async

This commit is contained in:
coderaiser 2020-08-05 17:53:40 +03:00
parent 807a1bc26d
commit 16a1eade2a
2 changed files with 46 additions and 91 deletions

View file

@ -2,9 +2,6 @@
/* global CloudCmd */
const {promisify} = require('es6-promisify');
const tryToCatch = require('try-to-catch');
CloudCmd.Markdown = exports;
const createElement = require('@cloudcmd/create-element');
@ -13,8 +10,6 @@ const Images = require('../dom/images');
const {Markdown} = require('../dom/rest');
const {alert} = require('../dom/dialog');
const read = promisify(Markdown.read);
module.exports.init = async () => {
Images.show.load('top');
await CloudCmd.View();
@ -38,7 +33,7 @@ async function show(name, options = {}) {
if (relative)
name += relativeQuery;
const [error, innerHTML] = await tryToCatch(read, name);
const [error, innerHTML] = await Markdown.read(name);
Images.hide();
if (error)