diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-02-18 16:42:41 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-02-18 16:42:41 +0900 |
| commit | 168b5bb723e9dd136ef33e958640778720a7827d (patch) | |
| tree | a2c6be5bb7eec83af02ac0e60ac7afff575d6ab7 /src/web/app/common/scripts/i.js | |
| parent | :v: (diff) | |
| download | misskey-168b5bb723e9dd136ef33e958640778720a7827d.tar.gz misskey-168b5bb723e9dd136ef33e958640778720a7827d.tar.bz2 misskey-168b5bb723e9dd136ef33e958640778720a7827d.zip | |
:v:
Diffstat (limited to 'src/web/app/common/scripts/i.js')
| -rw-r--r-- | src/web/app/common/scripts/i.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/web/app/common/scripts/i.js b/src/web/app/common/scripts/i.js new file mode 100644 index 0000000000..66ce37d506 --- /dev/null +++ b/src/web/app/common/scripts/i.js @@ -0,0 +1,20 @@ +const riot = require('riot'); + +module.exports = me => { + riot.mixin('i', { + init: () => { + this.I = me; + this.SIGNIN = me != null; + + if (this.SIGNIN) { + this.on('mount', () => { + me.on('updated', this.update); + }); + this.on('unmount', () => { + me.off('updated', this.update); + }); + } + }, + me: me + }); +}; |