diff --git a/components/app.js b/components/app.js index 706ca28..3bc5ff8 100644 --- a/components/app.js +++ b/components/app.js @@ -1012,8 +1012,9 @@ export default class App extends Component { fetchBacklog(client, target, after, before) { client.fetchHistoryBetween(target, after, before, CHATHISTORY_MAX_SIZE).catch((err) => { - this.setState({ error: "Failed to fetch history for '" + target + "': " + err }); - this.receipts.delete(channel); + console.error("Failed to fetch backlog for '" + target + "': ", err); + this.setState({ error: "Failed to fetch backlog for '" + target + "'" }); + this.receipts.delete(target); this.saveReceipts(); }); } diff --git a/lib/client.js b/lib/client.js index bedcf26..3d1fb90 100644 --- a/lib/client.js +++ b/lib/client.js @@ -704,6 +704,7 @@ export default class Client extends EventTarget { fetchBatch(msg, batchType) { let batchName = null; let messages = []; + let cmd = msg.command; return this.roundtrip(msg, (msg) => { if (batchName) { let batch = msg.batch; @@ -729,7 +730,7 @@ export default class Client extends EventTarget { } break; case "FAIL": - if (msg.params[0] === msg.command) { + if (msg.params[0] === cmd) { throw msg; } break;