You've already forked AstralRinth
forked from didirus/AstralRinth
* fix(theseus): Resolve log tab freezing entire app (#1127, #1237) Switched to `vue-typed-virtual-list` due to freezing issues in WebKit caused by `vue-virtual-scroller`, which were difficult to resolve with the previous library. * fix(theseus): Double opening of Socials Share link (#1136, #1074) * fix(theseus): Proper symlinks resolution (#1236) Ensures correct symlink resolution for specific mods, the mods directory, and the entire profile directory. * fix(theseus): Correctly recognize NeoForge mods (#1215) * fix(theseus): Corrected `Environments` and `Loaders` filters (#899) * fix(theseus): Remove `_JAVA_OPTIONS` when testing JRE (#1171) * fix(theseus): Fixed opening files using `show_in_folder` Previously, opening a mod would display the contents of the JAR file instead of its location. * fix(theseus): Hide `.DS_Store` files (#1274, #1002, #1174) * fix(theseus): Corrected tooltip color * fix(theseus): Fixed white mode issues (#1144, #1010) * fix: Corrected `Slider` min and max value handling (#1008) * fix: Fixed rebase problems * fix: Fixed `:deep` usage warning * chore: Updated eslint plugins to fix conflicts with Prettier
84 lines
2.0 KiB
JavaScript
84 lines
2.0 KiB
JavaScript
import { createApp } from 'vue'
|
|
import router from '@/routes'
|
|
import App from '@/App.vue'
|
|
import { createPinia } from 'pinia'
|
|
import '@modrinth/assets/omorphia.scss'
|
|
import '@/assets/stylesheets/global.scss'
|
|
import FloatingVue from 'floating-vue'
|
|
import 'floating-vue/dist/style.css'
|
|
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'
|
|
import { createPlugin } from '@vintl/vintl/plugin'
|
|
|
|
const VIntlPlugin = createPlugin({
|
|
controllerOpts: {
|
|
defaultLocale: 'en-US',
|
|
locale: 'en-US',
|
|
locales: [
|
|
{
|
|
tag: 'en-US',
|
|
meta: {
|
|
displayName: 'American English',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
globalMixin: true,
|
|
injectInto: [],
|
|
})
|
|
|
|
const pinia = createPinia()
|
|
|
|
let app = createApp(App)
|
|
app.use(router)
|
|
app.use(pinia)
|
|
app.use(FloatingVue)
|
|
app.mixin(loadCssMixin)
|
|
app.use(VIntlPlugin)
|
|
|
|
const mountedApp = app.mount('#app')
|
|
|
|
const raw_invoke = async (plugin, fn, args) => {
|
|
if (plugin === '') {
|
|
await invoke(fn, args)
|
|
} else {
|
|
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)
|
|
})
|