1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-01 00:08:31 +09:00

Merge remote-tracking branch 'upstream/develop' into flash-request-token

This commit is contained in:
Chocolate Pie 2023-06-07 11:53:25 +09:00
commit 38473c54a3
5 changed files with 15 additions and 3 deletions

View File

@ -12,7 +12,7 @@
-->
## 13.13.1 (unreleased)
## 13.13.1
### General
- プレイにAPI Tokenを要求できる関数を追加

View File

@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "13.13.0",
"version": "13.13.1",
"codename": "nasubi",
"repository": {
"type": "git",

View File

@ -19,7 +19,7 @@ export function useStream(): Misskey.Stream {
function heartbeat(): void {
if (stream != null && document.visibilityState === 'visible') {
stream.send('ping');
stream.heartbeat();
}
window.setTimeout(heartbeat, 1000 * 60);
}

View File

@ -2606,6 +2606,10 @@ export class Stream extends EventEmitter<StreamEvents> {
//
// (undocumented)
disconnectToChannel(connection: NonSharedConnection): void;
// (undocumented)
heartbeat(): void;
// (undocumented)
ping(): void;
// Warning: (ae-forgotten-export) The symbol "SharedConnection" needs to be exported by the entry point index.d.ts
//
// (undocumented)

View File

@ -186,6 +186,14 @@ export default class Stream extends EventEmitter<StreamEvents> {
this.stream.send(JSON.stringify(typeOrPayload));
}
public ping(): void {
this.stream.send('ping');
}
public heartbeat(): void {
this.stream.send('h');
}
/**
* Close this connection
*/