mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
extract AppInfo into a export const
This commit is contained in:
parent
e0abc4d386
commit
4e88835382
6 changed files with 16 additions and 8 deletions
|
@ -81,7 +81,6 @@ module.exports = {
|
|||
'requirejs': 'readonly',
|
||||
// Jellyfin globals
|
||||
'ApiClient': 'writable',
|
||||
'AppInfo': 'writable',
|
||||
'chrome': 'writable',
|
||||
'DlnaProfilePage': 'writable',
|
||||
'Dashboard': 'writable',
|
||||
|
|
4
src/components/AppInfo.js
Normal file
4
src/components/AppInfo.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
export default {
|
||||
isNativeApp: false
|
||||
};
|
|
@ -8,6 +8,7 @@ import itemHelper from './itemHelper';
|
|||
import loading from './loading/loading';
|
||||
import page from 'page';
|
||||
import viewManager from './viewManager/viewManager';
|
||||
import AppInfo from './AppInfo';
|
||||
|
||||
class AppRouter {
|
||||
allRoutes = [];
|
||||
|
|
|
@ -6,6 +6,7 @@ import '../../elements/emby-textarea/emby-textarea';
|
|||
import '../../elements/emby-input/emby-input';
|
||||
import '../../elements/emby-select/emby-select';
|
||||
import '../../elements/emby-button/emby-button';
|
||||
import AppInfo from '../../components/AppInfo';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import AppInfo from '../components/AppInfo';
|
||||
|
||||
export function getCurrentUser() {
|
||||
return window.ApiClient.getCurrentUser(false);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import 'whatwg-fetch';
|
|||
import 'resize-observer-polyfill';
|
||||
import 'jellyfin-noto';
|
||||
import '../assets/css/site.css';
|
||||
import AppInfo from '../components/AppInfo';
|
||||
|
||||
// TODO: Move this elsewhere
|
||||
window.getWindowLocationSearch = function(win) {
|
||||
|
@ -60,7 +61,11 @@ window.pageIdOn = function(eventName, id, fn) {
|
|||
});
|
||||
};
|
||||
|
||||
const AppInfo = {};
|
||||
if (self.appMode === 'cordova' || self.appMode === 'android' || self.appMode === 'standalone') {
|
||||
AppInfo.isNativeApp = true;
|
||||
}
|
||||
|
||||
Object.freeze(AppInfo);
|
||||
|
||||
function initClient() {
|
||||
function bindConnectionManagerEvents(connectionManager, events, userSettings) {
|
||||
|
@ -202,7 +207,7 @@ function initClient() {
|
|||
import('../assets/css/fonts.css');
|
||||
}
|
||||
|
||||
import('../assets/css/librarybrowser.css')
|
||||
import('../assets/css/librarybrowser.css');
|
||||
import('../components/apphost')
|
||||
.then(({ appHost }) => {
|
||||
loadPlugins(appHost, browser).then(function () {
|
||||
|
@ -365,10 +370,6 @@ function initClient() {
|
|||
|
||||
let localApiClient;
|
||||
|
||||
if (self.appMode === 'cordova' || self.appMode === 'android' || self.appMode === 'standalone') {
|
||||
AppInfo.isNativeApp = true;
|
||||
}
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue