なんかもうめっちゃ変えた
This commit is contained in:
parent
f8dddc81e2
commit
bc9a8283c6
77 changed files with 170 additions and 165 deletions
29
src/web/app/common/scripts/home-stream.ts
Normal file
29
src/web/app/common/scripts/home-stream.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
'use strict';
|
||||
|
||||
import Stream from './stream';
|
||||
import signout from './signout';
|
||||
|
||||
/**
|
||||
* Home stream connection
|
||||
*/
|
||||
class Connection extends Stream {
|
||||
constructor(me) {
|
||||
super('', {
|
||||
i: me.token
|
||||
});
|
||||
|
||||
// 最終利用日時を更新するため定期的にaliveメッセージを送信
|
||||
setInterval(() => {
|
||||
this.send({ type: 'alive' });
|
||||
}, 1000 * 60);
|
||||
|
||||
(this as any).on('i_updated', me.update);
|
||||
|
||||
(this as any).on('my_token_regenerated', () => {
|
||||
alert('%i18n:common.my-token-regenerated%');
|
||||
signout();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default Connection;
|
Loading…
Add table
Add a link
Reference in a new issue