mirror of
https://github.com/hyperspacedev/hyperspace
synced 2025-02-03 18:57:38 +01:00
Use new Federation scheme, convert JSON values for bools to boolean
This commit is contained in:
parent
87d5c8af25
commit
9e6e509f30
@ -6,11 +6,11 @@
|
||||
"logo": "logo.svg",
|
||||
"background": "background.png"
|
||||
},
|
||||
"developer": "true",
|
||||
"developer": true,
|
||||
"federation": {
|
||||
"universalLogin": "true",
|
||||
"allowPublicPosts": "true",
|
||||
"enablePublicTimeline": "true"
|
||||
"universalLogin": true,
|
||||
"allowPublicPosts": true,
|
||||
"enablePublicTimeline": true
|
||||
},
|
||||
"registration": {
|
||||
"defaultInstance": "mastodon.social"
|
||||
|
@ -21,6 +21,7 @@ import { Notification } from '../../types/Notification';
|
||||
import {sendNotificationRequest} from '../../utilities/notifications';
|
||||
import {withSnackbar} from 'notistack';
|
||||
import { getConfig, getUserDefaultBool } from '../../utilities/settings';
|
||||
import { Config } from '../../types/Config';
|
||||
|
||||
interface IAppLayoutState {
|
||||
acctMenuOpen: boolean;
|
||||
@ -70,12 +71,15 @@ export class AppLayout extends Component<any, IAppLayoutState> {
|
||||
})
|
||||
}
|
||||
|
||||
getConfig().then((config: any) => {
|
||||
this.setState({
|
||||
enableFederation: config.federated === "true",
|
||||
brandName: config.branding? config.branding.name: "Hyperspace",
|
||||
developerMode: config.developer === "true"
|
||||
});
|
||||
getConfig().then((result: any) => {
|
||||
if (result !== undefined) {
|
||||
let config: Config = result;
|
||||
this.setState({
|
||||
enableFederation: config.federation.enablePublicTimeline,
|
||||
brandName: config.branding? config.branding.name: "Hyperspace",
|
||||
developerMode: config.developer
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
this.streamNotifications()
|
||||
|
@ -65,7 +65,7 @@ class Composer extends Component<any, IComposerState> {
|
||||
let text = state.acct? `@${state.acct}: `: '';
|
||||
getConfig().then((config: any) => {
|
||||
this.setState({
|
||||
federated: config.federated === "true",
|
||||
federated: config.federation.allowPublicPosts,
|
||||
reply: state.reply,
|
||||
acct: state.acct,
|
||||
visibility: state.visibility,
|
||||
|
@ -43,6 +43,7 @@ import NotificationsIcon from '@material-ui/icons/Notifications';
|
||||
import BellAlertIcon from 'mdi-material-ui/BellAlert';
|
||||
import RefreshIcon from '@material-ui/icons/Refresh';
|
||||
import UndoIcon from '@material-ui/icons/Undo';
|
||||
import { Config } from '../types/Config';
|
||||
|
||||
interface ISettingsState {
|
||||
darkModeEnabled: boolean;
|
||||
@ -104,8 +105,12 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
}
|
||||
|
||||
getFederatedStatus() {
|
||||
getConfig().then((config: any) => {
|
||||
this.setState({ federated: config.federated === "true" });
|
||||
getConfig().then((result: any) => {
|
||||
if (result !== undefined) {
|
||||
let config: Config = result;
|
||||
console.log(config.federation.allowPublicPosts === false)
|
||||
this.setState({ federated: config.federation.allowPublicPosts });
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ export type Config = {
|
||||
logo?: string;
|
||||
background?: string;
|
||||
};
|
||||
developer?: string;
|
||||
developer?: boolean;
|
||||
federation: Federation;
|
||||
registration?: {
|
||||
defaultInstance?: string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user