Update boot.js
This commit is contained in:
		
							parent
							
								
									61896d2386
								
							
						
					
					
						commit
						70003269e5
					
				
					 1 changed files with 7 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -32,13 +32,15 @@
 | 
			
		|||
	//#region Detect app name
 | 
			
		||||
	let app = null;
 | 
			
		||||
 | 
			
		||||
	if (url.pathname == '/docs' || url.pathname.startsWith('/docs/')) app = 'docs';
 | 
			
		||||
	if (url.pathname == '/dev' || url.pathname.startsWith('/dev/')) app = 'dev';
 | 
			
		||||
	if (url.pathname == '/auth' || url.pathname.startsWith('/auth/')) app = 'auth';
 | 
			
		||||
	if (`${url.pathname}/`.startsWith('/docs/')) app = 'docs';
 | 
			
		||||
	if (`${url.pathname}/`.startsWith('/dev/')) app = 'dev';
 | 
			
		||||
	if (`${url.pathname}/`.startsWith('/auth/')) app = 'auth';
 | 
			
		||||
	//#endregion
 | 
			
		||||
 | 
			
		||||
	//#region Detect the user language
 | 
			
		||||
	let lang = navigator.language.split('-')[0];
 | 
			
		||||
	let lang = navigator.language;
 | 
			
		||||
 | 
			
		||||
	if (!LANGS.includes(lang)) lang = lang.split('-')[0];
 | 
			
		||||
 | 
			
		||||
	// The default language is English
 | 
			
		||||
	if (!LANGS.includes(lang)) lang = 'en';
 | 
			
		||||
| 
						 | 
				
			
			@ -104,7 +106,7 @@
 | 
			
		|||
	// グローバルにタイマーIDを代入しておく
 | 
			
		||||
	window.mkBootTimer = window.setTimeout(async () => {
 | 
			
		||||
		// Fetch meta
 | 
			
		||||
		const res = await fetch('/api/meta', {
 | 
			
		||||
		const res = await fetch(API + '/meta', {
 | 
			
		||||
			method: 'POST',
 | 
			
		||||
			cache: 'no-cache'
 | 
			
		||||
		});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue