Files
AstralRinth/theseus_gui/src/main.js
Wyatt Verchere 1e8852b540 Bugs again (#703)
* initial

* more fixes

* logs

* more fixes

* working rescuer

* minor log display fix

* mac fixes

* minor fix

* libsselinux1

* linux error

* actions test

* more bugs. Modpack page! BIG changes

* changed minimum 64 -> 8

* removed modpack page moved to modal

* removed unnecessary css

* mac compile

* many revs

* Merge colorful logs (#725)

* make implementation not dumb

* run prettier

* null -> true

* Add line numbers & make errors more robust.

* improvments

* changes; virtual scroll

---------

Co-authored-by: qtchaos <72168435+qtchaos@users.noreply.github.com>

* omorphia colors, comments fix

* fixes; _JAVA_OPTIONS

* revs

* mac specific

* more mac

* some fixes

* quick fix

* add java reinstall option

---------

Co-authored-by: qtchaos <72168435+qtchaos@users.noreply.github.com>
Co-authored-by: Jai A <jaiagr+gpg@pm.me>
2023-09-12 09:27:03 -07:00

65 lines
1.7 KiB
JavaScript

import { createApp } from 'vue'
import router from '@/routes'
import App from '@/App.vue'
import { createPinia } from 'pinia'
import 'omorphia/dist/style.css'
import '@/assets/stylesheets/global.scss'
import 'floating-vue/dist/style.css'
import FloatingVue from 'floating-vue'
import { get_opening_command, initialize_state } from '@/helpers/state'
import loadCssMixin from './mixins/macCssFix.js'
import { get } from '@/helpers/settings'
import { invoke } from '@tauri-apps/api'
import { isDev } from './helpers/utils.js'
const pinia = createPinia()
let app = createApp(App)
app.use(router)
app.use(pinia)
app.use(FloatingVue)
app.mixin(loadCssMixin)
const mountedApp = app.mount('#app')
const raw_invoke = async (plugin, fn, args) => {
if (plugin == '') {
return await invoke(fn, args)
} else {
return await invoke('plugin:' + plugin + '|' + fn, args)
}
}
isDev()
.then((dev) => {
if (dev) {
window.raw_invoke = raw_invoke
}
})
.catch((err) => {
console.error(err)
})
initialize_state()
.then(() => {
// First, redirect to other landing page if we have that setting
get()
.then((fetchSettings) => {
if (fetchSettings?.default_page && fetchSettings?.default_page !== 'Home') {
router.push({ name: fetchSettings?.default_page })
}
})
.catch((err) => {
console.error(err)
})
.finally(() => {
mountedApp.initialize()
get_opening_command().then((command) => {
console.log(JSON.stringify(command)) // change me to use whatever FE command handler is made
})
})
})
.catch((err) => {
console.error('Failed to initialize app', err)
mountedApp.failure(err)
})