[Glitch] [Proposal] Make able to write React in Typescript (#2190)
Port 4520e6473a
to glitch-soc
Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
* @property {boolean} activity_api_enabled
|
||||
* @property {string} admin
|
||||
* @property {boolean=} boost_modal
|
||||
* @property {boolean=} favourite_modal
|
||||
* @property {boolean} crop_images
|
||||
* @property {boolean=} delete_modal
|
||||
* @property {boolean=} disable_swiping
|
||||
@@ -81,7 +82,9 @@
|
||||
* @property {boolean=} use_pending_items
|
||||
* @property {string} version
|
||||
* @property {boolean} translation_enabled
|
||||
* @property {object} local_settings
|
||||
* @property {string} status_page_url
|
||||
* @property {boolean} system_emoji_font
|
||||
* @property {string} default_content_type
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -89,6 +92,9 @@
|
||||
* @property {Record<string, Account>} accounts
|
||||
* @property {InitialStateLanguage[]} languages
|
||||
* @property {InitialStateMeta} meta
|
||||
* @property {object} local_settings
|
||||
* @property {number} max_toot_chars
|
||||
* @property {number} poll_limits
|
||||
*/
|
||||
|
||||
const element = document.getElementById('initial-state');
|
||||
@@ -98,6 +104,7 @@ const initialState = element?.textContent && JSON.parse(element.textContent);
|
||||
// Glitch-soc-specific “local settings”
|
||||
if (initialState) {
|
||||
try {
|
||||
// @ts-expect-error
|
||||
initialState.local_settings = JSON.parse(localStorage.getItem('mastodon-settings'));
|
||||
} catch (e) {
|
||||
initialState.local_settings = {};
|
||||
|
Reference in New Issue
Block a user