Use different initial content for development/release

#build
This commit is contained in:
Jonatan Heyman 2023-01-15 20:24:31 +01:00
parent 895bd4eccc
commit 996d4338ce
3 changed files with 17 additions and 5 deletions

View File

@ -63,7 +63,7 @@ async function createWindow() {
//nativeTheme.themeSource = "light"
if (process.env.VITE_DEV_SERVER_URL) { // electron-vite-vue#298
win.loadURL(url)
win.loadURL(url + '?dev=1')
// Open devTool if the app is not packaged
//win.webContents.openDevTools()
} else {

View File

@ -20,6 +20,7 @@
theme: window.darkMode.initial,
initialTheme: window.darkMode.initial,
systemTheme: 'system',
development: window.location.href.indexOf("dev=1") !== -1,
}
},
@ -66,6 +67,7 @@
<Editor
@cursorChange="onCursorChange"
:theme="theme"
:development="development"
class="editor"
/>
<StatusBar

View File

@ -1,11 +1,22 @@
<script>
import { ref, shallowRef } from 'vue'
import { HeynoteEditor } from '../editor/editor.js'
import initialData from "../editor/fixture.js"
import testContent from "../editor/fixture.js"
const initialContent = `
text-a
Welcome to Heynote!
[ + Enter] Insert new note block
[ + A] Select all text in a note block. Press again to select the whole scratchpad
[ + + Up/Down]  Add additional cursor above/below
text-a
`
export default {
props: [
"theme",
"development",
],
mounted() {
this.$refs.editor.addEventListener("selectionChange", (e) => {
@ -19,8 +30,7 @@
this.editor = new HeynoteEditor({
element: this.$refs.editor,
//content: "\ntext\n",
content: initialData,
content: this.development ? testContent : initialContent,
theme: this.theme,
})
},