Add get timeline to Column component

Change to uncomment import Column of Main component
This commit is contained in:
kPherox 2019-05-19 23:29:36 +09:00
parent e8f73dbaa8
commit a931e82f41
No known key found for this signature in database
GPG Key ID: C04751C2BFA2F62D
2 changed files with 13 additions and 5 deletions

View File

@ -8,7 +8,7 @@
<script lang="ts"> <script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator' import { Component, Prop, Vue } from 'vue-property-decorator'
// import Column from '@/components/Timeline/Column.vue' import Column from '@/components/Timeline/Column.vue'
interface TimelineDoc { interface TimelineDoc {
_id: string _id: string
@ -18,7 +18,7 @@ interface TimelineDoc {
@Component({ @Component({
components: { components: {
//Column, Column,
} }
}) })
export default class Main extends Vue { export default class Main extends Vue {

View File

@ -14,6 +14,11 @@ import Toot from '@/components/Timeline/Toot.vue'
import "@/extensions/map-sortbyvalue" // Add sortByValue function to Map prototype import "@/extensions/map-sortbyvalue" // Add sortByValue function to Map prototype
interface TimelineDoc {
name: string
type: string
}
type Statuses = Map<number, Status> type Statuses = Map<number, Status>
@Component({ @Component({
@ -22,7 +27,9 @@ type Statuses = Map<number, Status>
} }
}) })
export default class Column extends Vue { export default class Column extends Vue {
@Prop() public id?: string @Prop({
required: true
}) public id!: string
//test //test
public pref = { public pref = {
@ -49,8 +56,9 @@ export default class Column extends Vue {
created() { created() {
// timelinenametypethis.id // timelinenametypethis.id
this.name = '' let doc: TimelineDoc = ipcRenderer.sendSync('get-timeline', this.id)
this.type = '' this.name = doc.name
this.type = doc.type
// TODO: channeltimelineid // TODO: channeltimelineid
ipcRenderer.once(`timeline-${this.name}-${this.type}`, (e: Event, statuses: Status[], error?: Error) => { ipcRenderer.once(`timeline-${this.name}-${this.type}`, (e: Event, statuses: Status[], error?: Error) => {
if (error === undefined) { if (error === undefined) {