wip
This commit is contained in:
		@@ -10,9 +10,9 @@ export const host = address.host;
 | 
				
			|||||||
export const hostname = address.hostname;
 | 
					export const hostname = address.hostname;
 | 
				
			||||||
export const url = address.origin;
 | 
					export const url = address.origin;
 | 
				
			||||||
export const apiUrl = location.origin + '/api';
 | 
					export const apiUrl = location.origin + '/api';
 | 
				
			||||||
 | 
					export const lang = localStorage.getItem('lang') ?? 'en-US';
 | 
				
			||||||
export const langs = _LANGS_;
 | 
					export const langs = _LANGS_;
 | 
				
			||||||
const preParseLocale = miLocalStorage.getItem('locale');
 | 
					const preParseLocale = localStorage.getItem('locale');
 | 
				
			||||||
export const locale = preParseLocale ? JSON.parse(preParseLocale) : null;
 | 
					export const locale = preParseLocale ? JSON.parse(preParseLocale) : null;
 | 
				
			||||||
export const instanceName = siteName === 'Misskey' || siteName == null ? host : siteName;
 | 
					export const instanceName = siteName === 'Misskey' || siteName == null ? host : siteName;
 | 
				
			||||||
export const ui = miLocalStorage.getItem('ui');
 | 
					export const debug = localStorage.getItem('debug') === 'true';
 | 
				
			||||||
export const debug = miLocalStorage.getItem('debug') === 'true';
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,8 +5,17 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import { shallowRef, computed, markRaw, watch } from 'vue';
 | 
					import { shallowRef, computed, markRaw, watch } from 'vue';
 | 
				
			||||||
import * as Misskey from 'misskey-js';
 | 
					import * as Misskey from 'misskey-js';
 | 
				
			||||||
import { misskeyApi, misskeyApiGet } from '@/scripts/misskey-api.js';
 | 
					import { misskeyApi, misskeyApiGet } from '@/misskey-api.js';
 | 
				
			||||||
import { get, set } from '@/scripts/idb-proxy.js';
 | 
					
 | 
				
			||||||
 | 
					function get(key: string) {
 | 
				
			||||||
 | 
						const value = localStorage.getItem(key);
 | 
				
			||||||
 | 
						if (value === null) return null;
 | 
				
			||||||
 | 
						return JSON.parse(value);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function set(key: string, value: any) {
 | 
				
			||||||
 | 
						localStorage.setItem(key, JSON.stringify(value));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const storageCache = await get('emojis');
 | 
					const storageCache = await get('emojis');
 | 
				
			||||||
export const customEmojis = shallowRef<Misskey.entities.EmojiSimple[]>(Array.isArray(storageCache) ? storageCache : []);
 | 
					export const customEmojis = shallowRef<Misskey.entities.EmojiSimple[]>(Array.isArray(storageCache) ? storageCache : []);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -72,6 +72,7 @@ export function getConfig(): UserConfig {
 | 
				
			|||||||
			extensions,
 | 
								extensions,
 | 
				
			||||||
			alias: {
 | 
								alias: {
 | 
				
			||||||
				'@/': __dirname + '/src/',
 | 
									'@/': __dirname + '/src/',
 | 
				
			||||||
 | 
									'/client-assets/': __dirname + '/assets/',
 | 
				
			||||||
				'/static-assets/': __dirname + '/../backend/assets/'
 | 
									'/static-assets/': __dirname + '/../backend/assets/'
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user