tiny fixes

This commit is contained in:
azivner 2019-01-02 22:36:06 +01:00
parent 1581464d8c
commit ef1c840aa7
2 changed files with 10 additions and 7 deletions

View file

@ -15,7 +15,8 @@ const ENTITY_NAME_TO_ENTITY = {
"note_revisions": NoteRevision,
"recent_notes": RecentNote,
"options": Option,
"api_tokens": ApiToken
"api_tokens": ApiToken,
"links": Link
};
function getEntityFromEntityName(entityName) {

View file

@ -52,13 +52,15 @@ async function sendMessage(client, message) {
async function sendMessageToAllClients(message) {
const jsonStr = JSON.stringify(message);
log.info("Sending message to all clients: " + jsonStr);
if (webSocketServer) {
log.info("Sending message to all clients: " + jsonStr);
webSocketServer.clients.forEach(function each(client) {
if (client.readyState === WebSocket.OPEN) {
client.send(jsonStr);
}
});
webSocketServer.clients.forEach(function each(client) {
if (client.readyState === WebSocket.OPEN) {
client.send(jsonStr);
}
});
}
}
async function sendPing(client, lastSentSyncId) {