mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-28 11:00:26 -05:00
Fix JS crashing if initial-state is not set (#2193)
Fixes issues with the JS for at least sign-up pages not working
This commit is contained in:
parent
2ebbfebfe9
commit
5b58ebb04f
@ -96,10 +96,12 @@ const element = document.getElementById('initial-state');
|
|||||||
const initialState = element?.textContent && JSON.parse(element.textContent);
|
const initialState = element?.textContent && JSON.parse(element.textContent);
|
||||||
|
|
||||||
// Glitch-soc-specific “local settings”
|
// Glitch-soc-specific “local settings”
|
||||||
try {
|
if (initialState) {
|
||||||
|
try {
|
||||||
initialState.local_settings = JSON.parse(localStorage.getItem('mastodon-settings'));
|
initialState.local_settings = JSON.parse(localStorage.getItem('mastodon-settings'));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
initialState.local_settings = {};
|
initialState.local_settings = {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user