Merge pull request #513 from h3poteto/iss-512

closes #512 Add show profile menu
This commit is contained in:
AkiraFukushima 2018-08-18 16:08:48 +09:00 committed by GitHub
commit cedc4057da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 2 deletions

View File

@ -35,6 +35,7 @@
}
},
"side_menu": {
"show_profile": "Profil ansehen",
"edit_profile": "Profil bearbeiten",
"home": "Home",
"notification": "Benachrichtigung",

View File

@ -35,6 +35,7 @@
}
},
"side_menu": {
"show_profile": "Show profile",
"edit_profile": "Edit profile",
"home": "Home",
"notification": "Notification",

View File

@ -35,6 +35,7 @@
}
},
"side_menu": {
"show_profile": "Voir le profil",
"edit_profile": "Éditer mon profil",
"home": "Accueil",
"notification": "Notifications",

View File

@ -35,7 +35,8 @@
}
},
"side_menu": {
"edit_profile": "編集",
"show_profile": "プロフィール確認",
"edit_profile": "プロフィール編集",
"home": "ホーム",
"notification": "通知",
"favourite": "お気に入り",

View File

@ -43,7 +43,7 @@ export default {
load () {
this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/Timeline/fetchTimeline', this.account)
.catch(() => {
this.message({
this.$message({
message: this.$t('message.timeline_fetch_error'),
type: 'error'
})

View File

@ -11,6 +11,7 @@
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="show">{{ $t("side_menu.show_profile") }}</el-dropdown-item>
<el-dropdown-item command="edit">{{ $t("side_menu.edit_profile") }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@ -115,6 +116,16 @@ export default {
},
handleProfile (command) {
switch (command) {
case 'show':
const accountURL = `${this.account.baseURL}/@${this.account.username}`
this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/searchAccount', accountURL)
.then((account) => {
this.$store.dispatch('TimelineSpace/Contents/SideBar/AccountProfile/changeAccount', account)
this.$store.commit('TimelineSpace/Contents/SideBar/changeOpenSideBar', true)
})
this.$store.dispatch('TimelineSpace/Contents/SideBar/openAccountComponent')
break
case 'edit':
shell.openExternal(this.account.baseURL + '/settings/profile')
break