1
0
mirror of https://github.com/elk-zone/elk synced 2024-11-23 14:46:08 +09:00

perf: remove semver dependency and skip version checks (#509)

This commit is contained in:
Daniel Roe 2022-12-22 14:22:56 +00:00 committed by GitHub
parent 3442adbeb6
commit 8d8b2b0a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -44,14 +44,13 @@ export const useUsers = () => users
export const characterLimit = computed(() => currentInstance.value?.configuration.statuses.maxCharacters ?? DEFAULT_POST_CHARS_LIMIT)
async function loginTo(user?: Omit<UserLogin, 'account'> & { account?: AccountCredentials }) {
const config = useRuntimeConfig()
const route = useRoute()
const router = useRouter()
const server = user?.server || route.params.server as string || publicServer.value
const masto = await loginMasto({
url: `https://${server}`,
accessToken: user?.token,
disableVersionCheck: !!config.public.disableVersionCheck,
disableVersionCheck: true,
// Suppress warning of `masto/fetch` usage
disableExperimentalWarning: true,
})

View File

@ -40,6 +40,8 @@ export default defineNuxtConfig({
'querystring': 'rollup-plugin-node-polyfills/polyfills/qs',
'masto/fetch': 'masto/fetch',
'masto': 'masto/fetch',
'change-case': 'scule',
'semver': 'unenv/runtime/mock/empty',
},
vite: {
define: {
@ -84,10 +86,6 @@ export default defineNuxtConfig({
env: isCI ? isPreview ? 'staging' : 'production' : 'local',
pwaEnabled: !isDevelopment || process.env.VITE_DEV_PWA === 'true',
translateApi: '',
// Masto uses Mastodon version checks to see what features are enabled.
// Mastodon alternatives like GoToSocial will always fail these checks, so
// provide a way to disable them.
disableVersionCheck: false,
},
storage: {
driver: isCI ? 'cloudflare' : 'fs',