1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-01-11 08:24:58 +01:00

refs #118 Move NewTootModal component under Modals

This commit is contained in:
AkiraFukushima 2018-03-29 11:25:35 +09:00
parent 09e9755fe9
commit e9304e5378
6 changed files with 19 additions and 19 deletions

View File

@ -9,7 +9,7 @@
<router-view></router-view>
</div>
</div>
<new-toot-modal></new-toot-modal>
<new-toot></new-toot>
<jump-modal></jump-modal>
<image-viewer></image-viewer>
</div>
@ -18,13 +18,13 @@
<script>
import SideMenu from './TimelineSpace/SideMenu'
import HeaderMenu from './TimelineSpace/HeaderMenu'
import NewTootModal from './TimelineSpace/NewTootModal'
import NewToot from './TimelineSpace/Modals/NewToot'
import JumpModal from './TimelineSpace/JumpModal'
import ImageViewer from './TimelineSpace/Modals/ImageViewer'
export default {
name: 'timeline-space',
components: { SideMenu, HeaderMenu, NewTootModal, JumpModal, ImageViewer },
components: { SideMenu, HeaderMenu, NewToot, JumpModal, ImageViewer },
created () {
const loading = this.$loading({
lock: true,

View File

@ -76,7 +76,7 @@ export default {
}
},
openReply (message) {
this.$store.dispatch('TimelineSpace/NewTootModal/openReply', message)
this.$store.dispatch('TimelineSpace/Modals/NewToot/openReply', message)
},
changeReblog (message) {
if (message.reblogged) {

View File

@ -21,7 +21,7 @@
import { mapState } from 'vuex'
export default {
name: 'new-toot-modal',
name: 'new-toot',
data () {
return {
ctrlPressed: false
@ -30,8 +30,8 @@ export default {
computed: {
...mapState({
replyToId: (state) => {
if (state.TimelineSpace.NewTootModal.replyToMessage !== null) {
return state.TimelineSpace.NewTootModal.replyToMessage.id
if (state.TimelineSpace.Modals.NewToot.replyToMessage !== null) {
return state.TimelineSpace.Modals.NewToot.replyToMessage.id
} else {
return null
}
@ -39,18 +39,18 @@ export default {
}),
newTootModal: {
get () {
return this.$store.state.TimelineSpace.NewTootModal.modalOpen
return this.$store.state.TimelineSpace.Modals.NewToot.modalOpen
},
set (value) {
this.$store.dispatch('TimelineSpace/NewTootModal/changeModal', value)
this.$store.dispatch('TimelineSpace/Modals/NewToot/changeModal', value)
}
},
status: {
get () {
return this.$store.state.TimelineSpace.NewTootModal.status
return this.$store.state.TimelineSpace.Modals.NewToot.status
},
set (value) {
this.$store.commit('TimelineSpace/NewTootModal/updateStatus', value)
this.$store.commit('TimelineSpace/Modals/NewToot/updateStatus', value)
}
}
},
@ -61,7 +61,7 @@ export default {
},
methods: {
close () {
this.$store.dispatch('TimelineSpace/NewTootModal/changeModal', false)
this.$store.dispatch('TimelineSpace/Modals/NewToot/changeModal', false)
},
keydown (e) {
if (e.keyCode === 17 || e.keyCode === 93) {
@ -95,7 +95,7 @@ export default {
in_reply_to_id: this.replyToId
})
}
this.$store.dispatch('TimelineSpace/NewTootModal/postToot', form)
this.$store.dispatch('TimelineSpace/Modals/NewToot/postToot', form)
.then(() => {
this.close()
this.$message({

View File

@ -7,7 +7,6 @@ import Favourites from './TimelineSpace/Favourites'
import Local from './TimelineSpace/Local'
import Public from './TimelineSpace/Public'
import Cards from './TimelineSpace/Cards'
import NewTootModal from './TimelineSpace/NewTootModal'
import JumpModal from './TimelineSpace/JumpModal'
import Modals from './TimelineSpace/Modals'
import router from '../router'
@ -22,7 +21,6 @@ const TimelineSpace = {
Local,
Public,
Cards,
NewTootModal,
JumpModal,
Modals
},
@ -162,7 +160,7 @@ const TimelineSpace = {
},
watchShortcutEvents ({ commit }) {
ipcRenderer.on('CmdOrCtrl+N', () => {
commit('TimelineSpace/NewTootModal/changeModal', true, { root: true })
commit('TimelineSpace/Modals/NewToot/changeModal', true, { root: true })
})
ipcRenderer.on('CmdOrCtrl+K', () => {
commit('TimelineSpace/JumpModal/changeModal', true, { root: true })

View File

@ -1,9 +1,11 @@
import NewToot from './Modals/NewToot'
import ImageViewer from './Modals/ImageViewer'
const Modals = {
namespaced: true,
modules: {
ImageViewer
ImageViewer,
NewToot
}
}

View File

@ -1,6 +1,6 @@
import Mastodon from 'mastodon-api'
const NewTootModal = {
const NewToot = {
namespaced: true,
state: {
modalOpen: false,
@ -51,6 +51,6 @@ const NewTootModal = {
}
}
export default NewTootModal
export default NewToot
class AuthenticationError {}