WIP: Switch Main/Welcome component

This commit is contained in:
kPherox 2019-04-27 04:28:19 +09:00
parent 69e5fb3f1b
commit 4094a32ab2
No known key found for this signature in database
GPG Key ID: C04751C2BFA2F62D
3 changed files with 32 additions and 2 deletions

20
src/components/Main.vue Normal file
View File

@ -0,0 +1,20 @@
<template>
<div id="main">
<!-- 仮置き -->
<p>Main View</p>
</div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
@Component({
components: {
}
})
export default class Main extends Vue {
}
</script>
<style lang="postcss">
</style>

View File

@ -75,7 +75,7 @@ export default class Auth {
accessToken: tokenData.accessToken,
color: undefined
}
db.insert(docs, function(err, newDocs) {
db.insert(docs, function (err, newDocs) {
if (err) {
event.sender.send(`error`, {
id: "ERROR_YOU_TRY_ANOTHER_ACCOUNT",

View File

@ -1,21 +1,26 @@
<template>
<div id="app" :style="styles">
<Welcome/>
<Welcome v-if="isStartup"/>
<Main v-else/>
</div>
</template>
<script lang="ts">
import { ipcRenderer } from 'electron'
import { Component, Vue } from 'vue-property-decorator'
import Main from '@/components/Main.vue'
import Welcome from '@/components/Welcome.vue'
@Component({
components: {
Main,
Welcome,
},
})
export default class App extends Vue {
public isDarkMode!: boolean
public isStartup!: boolean
public fontSize!: string
public get styles(): { [key: string]: string } {
@ -28,11 +33,16 @@ export default class App extends Vue {
created() {
this.isDarkMode = ipcRenderer.sendSync('dark-theme')
this.isStartup = true // TODO: ipcboolean
this.fontSize = '16px'
}
mounted() {
ipcRenderer.on('change-color-theme', () => this.isDarkMode = ipcRenderer.sendSync('dark-theme'))
// TODO: TL
if (this.isStartup) {
//ipcRenderer.once('add-account-or-timeline', () => this.isStartup = false)
}
}
beforeDestroy() {