mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2025-02-25 08:23:04 +00:00
18 lines
457 B
TypeScript
18 lines
457 B
TypeScript
import { Context } from '@nuxt/types';
|
|
|
|
/**
|
|
* Middleware providing a redirect to the server selection page in case the
|
|
* Axios base URL is the default (non-working) one.
|
|
*
|
|
* @param {Context} context - Nuxt application context
|
|
* @returns {void}
|
|
*/
|
|
export default function (context: Context): void {
|
|
if (
|
|
!context.$axios.defaults.baseURL ||
|
|
!context.store.state.servers.serverList.length
|
|
) {
|
|
return context.redirect('/addserver');
|
|
}
|
|
}
|