[Client] Fix bug

This commit is contained in:
syuilo 2017-06-07 16:45:19 +09:00
parent d48e570c34
commit 8ebe89293a
1 changed files with 13 additions and 5 deletions

View File

@ -2,9 +2,9 @@
<p>%i18n:common.tags.mk-twitter-setting.description%<a href={ CONFIG.aboutUrl + '/link-to-twitter' } target="_blank">%i18n:common.tags.mk-twitter-setting.detail%</a></p> <p>%i18n:common.tags.mk-twitter-setting.description%<a href={ CONFIG.aboutUrl + '/link-to-twitter' } target="_blank">%i18n:common.tags.mk-twitter-setting.detail%</a></p>
<p class="account" if={ I.twitter } title={ 'Twitter ID: ' + I.twitter.user_id }>%i18n:common.tags.mk-twitter-setting.connected-to%: <a href={ 'https://twitter.com/' + I.twitter.screen_name } target="_blank">@{ I.twitter.screen_name }</a></p> <p class="account" if={ I.twitter } title={ 'Twitter ID: ' + I.twitter.user_id }>%i18n:common.tags.mk-twitter-setting.connected-to%: <a href={ 'https://twitter.com/' + I.twitter.screen_name } target="_blank">@{ I.twitter.screen_name }</a></p>
<p> <p>
<a href={ CONFIG.apiUrl + '/connect/twitter' } target="_blank" onclick={ authorize }>{ I.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }</a> <a href={ CONFIG.apiUrl + '/connect/twitter' } target="_blank" onclick={ connect }>{ I.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }</a>
<span if={ I.twitter }> or </span> <span if={ I.twitter }> or </span>
<a href={ CONFIG.apiUrl + '/disconnect/twitter' } target="_blank" if={ I.twitter }>%i18n:common.tags.mk-twitter-setting.disconnect%</a> <a href={ CONFIG.apiUrl + '/disconnect/twitter' } target="_blank" if={ I.twitter } onclick={ disconnect }>%i18n:common.tags.mk-twitter-setting.disconnect%</a>
</p> </p>
<p class="id" if={ I.twitter }>Twitter ID: { I.twitter.user_id }</p> <p class="id" if={ I.twitter }>Twitter ID: { I.twitter.user_id }</p>
<style> <style>
@ -35,7 +35,7 @@
this.I.on('updated', this.onMeUpdated); this.I.on('updated', this.onMeUpdated);
}); });
this.on('mount', () => { this.on('unmount', () => {
this.I.off('updated', this.onMeUpdated); this.I.off('updated', this.onMeUpdated);
}); });
@ -45,10 +45,18 @@
} }
}; };
this.authorize = e => { this.connect = e => {
e.preventDefault(); e.preventDefault();
this.form = window.open(CONFIG.apiUrl + '/connect/twitter', this.form = window.open(CONFIG.apiUrl + '/connect/twitter',
'twitter_authorize_window', 'twitter_connect_window',
'height=570,width=520');
return false;
};
this.disconnect = e => {
e.preventDefault();
window.open(CONFIG.apiUrl + '/disconnect/twitter',
'twitter_disconnect_window',
'height=570,width=520'); 'height=570,width=520');
return false; return false;
}; };