From 2fa1ec6f342c8fcf11189deb8e9bfc7b5cbc958e Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 9 Mar 2021 00:10:59 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9D=97=20Async=20rewrite=20of=20entire=20mod?= =?UTF-8?q?ule=20!=20=E2=9C=A8=20Channels=20list=20now=20fully=20asynchron?= =?UTF-8?q?ous=20=E2=9C=A8=20html=20pusher=20is=20now=20its=20own=20functi?= =?UTF-8?q?on=20for=20cleanness=20=E2=9E=95=20New=20ANY=5FCHANNEL=20intege?= =?UTF-8?q?r=20is=20supported=20by=20the=20backend=20for=20requesting=20al?= =?UTF-8?q?l=20channels=20in=20one=20go=20instead=20of=20voice|text=20?= =?UTF-8?q?=E2=9E=96=20Removed=20more=20callback=20hell=20code=20=E2=9C=A8?= =?UTF-8?q?=20JSDocs=20updated=20to=20reflect=20their=20respective=20funct?= =?UTF-8?q?ion=20signatures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- freechat-client/src/auth.js | 1 - freechat-client/src/channels.js | 130 ++++++++++++++------------------ 2 files changed, 57 insertions(+), 74 deletions(-) diff --git a/freechat-client/src/auth.js b/freechat-client/src/auth.js index fde8d69..9fc7b9c 100644 --- a/freechat-client/src/auth.js +++ b/freechat-client/src/auth.js @@ -46,7 +46,6 @@ exports.init = async function() { continue } } - console.log('after init', config) await ipcRenderer.invoke('config-update', config) return await ipcRenderer.invoke('config-request') diff --git a/freechat-client/src/channels.js b/freechat-client/src/channels.js index aa3bd78..c8df59b 100644 --- a/freechat-client/src/channels.js +++ b/freechat-client/src/channels.js @@ -5,98 +5,82 @@ const got = require('got') const msg = require('./messages.js') +const ANY_CHANNEL = 0 const VOICE_KIND = 1 const TEXT_KIND = 2 /** - * - * @param {String} proto | http/https - * @param {String} domain | domain of the instance we're looking at - * @param {Number} port | Should always be the default value of 4536 but other owner - * @param {Object} params | object with jwt + id fields + * Channel button id's have the format of ${hostname}:${channel['name']} + * Helper function that literally just pushes out some bs to the DOM * - * @note This function fails quietly for the sake of not destroying the UI instantly - * Errors get logged for now since those are in the debugger anyway but everything else - * is basically really quiet + * @param {String} server.hostname + * @param {u16} server.port + * @param {String} server.protocol * + * @param {u64} user.id + * @param {String} user.jwt + * + * @param {u64} channel.id + * @param {String} channel.name + * @param {String} channel.description + * @param {i32} channel.kind */ -function update_channels_list(proto, hostname, port, params) { - const url = `${proto}://${hostname}:${port}/channels/list` +function push(server, user, channel) { + $('#channels-list').append( + $('
  • ').append( + $('

    ').append( + $('