mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-23 21:43:09 +02:00
[Client] Fix bug
This commit is contained in:
parent
3d4e3c1e88
commit
99b16d056b
3 changed files with 25 additions and 13 deletions
|
@ -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",
|
||||
|
|
|
@ -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 = () => {
|
||||
|
|
|
@ -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 = () => {
|
||||
|
|
Loading…
Reference in a new issue