[Client] Fix bug

This commit is contained in:
syuilo 2017-03-21 18:26:11 +09:00
parent 3d4e3c1e88
commit 99b16d056b
3 changed files with 25 additions and 13 deletions

View file

@ -1,7 +1,7 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "0.0.1410",
"version": "0.0.1413",
"license": "MIT",
"description": "A miniblog-based SNS",
"bugs": "https://github.com/syuilo/misskey/issues",

View file

@ -364,24 +364,29 @@
}
};
this.capture = () => {
this.onStreamConnected = () => {
this.capture();
};
this.capture = withHandler => {
this.stream.send({
type: 'capture',
id: this.post.id
});
this.stream.on('post-updated', this.onStreamPostUpdated);
if (withHandler) this.stream.on('post-updated', this.onStreamPostUpdated);
};
this.decapture = () => {
this.decapture = withHandler => {
this.stream.send({
type: 'decapture',
id: this.post.id
});
this.stream.off('post-updated', this.onStreamPostUpdated);
if (withHandler) this.stream.off('post-updated', this.onStreamPostUpdated);
};
this.on('mount', () => {
this.capture();
this.capture(true);
this.stream.on('_connected_', this.onStreamConnected);
if (this.p.text) {
const tokens = this.p.ast;
@ -404,7 +409,8 @@
});
this.on('unmount', () => {
this.decapture();
this.decapture(true);
this.stream.off('_connected_', this.onStreamConnected);
});
this.reply = () => {

View file

@ -340,24 +340,29 @@
}
};
this.capture = () => {
this.onStreamConnected = () => {
this.capture();
};
this.capture = withHandler => {
this.stream.send({
type: 'capture',
id: this.post.id
});
this.stream.on('post-updated', this.onStreamPostUpdated);
if (withHandler) this.stream.on('post-updated', this.onStreamPostUpdated);
};
this.decapture = () => {
this.decapture = withHandler => {
this.stream.send({
type: 'decapture',
id: this.post.id
});
this.stream.off('post-updated', this.onStreamPostUpdated);
if (withHandler) this.stream.off('post-updated', this.onStreamPostUpdated);
};
this.on('mount', () => {
this.capture();
this.capture(true);
this.stream.on('_connected_', this.onStreamConnected);
if (this.p.text) {
const tokens = this.p.ast;
@ -380,7 +385,8 @@
});
this.on('unmount', () => {
this.decapture();
this.decapture(true);
this.stream.off('_connected_', this.onStreamConnected);
});
this.reply = () => {