Comment out unnecessary console logs and update getConfig
This commit is contained in:
parent
931244cb5a
commit
33d42991f3
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hyperspace",
|
"name": "hyperspace",
|
||||||
"version": "1.1.0-beta2",
|
"version": "1.1.0-beta4",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -324,7 +324,7 @@ export class AppLayout extends Component<any, IAppLayoutState> {
|
||||||
*/
|
*/
|
||||||
searchForQuery(what: string) {
|
searchForQuery(what: string) {
|
||||||
what = what.replace(/^#/g, "tag:");
|
what = what.replace(/^#/g, "tag:");
|
||||||
console.log(what);
|
// console.log(what);
|
||||||
window.location.href = isDesktopApp()
|
window.location.href = isDesktopApp()
|
||||||
? "hyperspace://hyperspace/app/index.html#/search?query=" + what
|
? "hyperspace://hyperspace/app/index.html#/search?query=" + what
|
||||||
: "/#/search?query=" + what;
|
: "/#/search?query=" + what;
|
||||||
|
|
|
@ -119,7 +119,7 @@ export class Post extends React.Component<any, IPostState> {
|
||||||
})
|
})
|
||||||
.catch((err: Error) => {
|
.catch((err: Error) => {
|
||||||
this.props.enqueueSnackbar("Couldn't delete post: " + err.name);
|
this.props.enqueueSnackbar("Couldn't delete post: " + err.name);
|
||||||
console.log(err.message);
|
console.error(err.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,7 +405,7 @@ export class Post extends React.Component<any, IPostState> {
|
||||||
emojis.concat(reblogger.emojis);
|
emojis.concat(reblogger.emojis);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(post);
|
// console.log(post);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -83,7 +83,7 @@ class ActivityPage extends Component<any, IActivityPageState> {
|
||||||
viewLoading: false,
|
viewLoading: false,
|
||||||
viewErrored: true
|
viewErrored: true
|
||||||
});
|
});
|
||||||
console.log(err.message);
|
console.error(err.message);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.client
|
this.client
|
||||||
|
@ -101,7 +101,7 @@ class ActivityPage extends Component<any, IActivityPageState> {
|
||||||
viewLoading: false,
|
viewLoading: false,
|
||||||
viewErrored: true
|
viewErrored: true
|
||||||
});
|
});
|
||||||
console.log(err.message);
|
console.error(err.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ class SearchPage extends Component<any, ISearchPageState> {
|
||||||
viewDidLoad: true,
|
viewDidLoad: true,
|
||||||
viewIsLoading: false
|
viewIsLoading: false
|
||||||
});
|
});
|
||||||
console.log(this.state.tagResults);
|
// console.log(this.state.tagResults);
|
||||||
})
|
})
|
||||||
.catch((err: Error) => {
|
.catch((err: Error) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
@ -170,7 +170,7 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||||
getConfig().then((result: any) => {
|
getConfig().then((result: any) => {
|
||||||
if (result !== undefined) {
|
if (result !== undefined) {
|
||||||
let config: Config = result;
|
let config: Config = result;
|
||||||
console.log(!config.federation.allowPublicPosts);
|
// console.log(!config.federation.allowPublicPosts);
|
||||||
this.setState({
|
this.setState({
|
||||||
federated: config.federation.allowPublicPosts
|
federated: config.federation.allowPublicPosts
|
||||||
});
|
});
|
||||||
|
|
|
@ -74,7 +74,7 @@ class You extends Component<IYouProps, IYouState> {
|
||||||
|
|
||||||
getAccount() {
|
getAccount() {
|
||||||
let acct = localStorage.getItem("account");
|
let acct = localStorage.getItem("account");
|
||||||
console.log(acct);
|
// console.log(acct);
|
||||||
if (acct) {
|
if (acct) {
|
||||||
return JSON.parse(acct);
|
return JSON.parse(acct);
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,15 @@ export function createUserDefaults() {
|
||||||
export async function getConfig(): Promise<Config | undefined> {
|
export async function getConfig(): Promise<Config | undefined> {
|
||||||
try {
|
try {
|
||||||
const resp = await axios.get("config.json");
|
const resp = await axios.get("config.json");
|
||||||
|
|
||||||
|
let { location } = resp.data;
|
||||||
|
|
||||||
|
if (!location.endsWith("/")) {
|
||||||
|
console.warn(
|
||||||
|
"Location does not have a backslash, so Hyperspace has added it automatically."
|
||||||
|
);
|
||||||
|
resp.data.location = location + "/";
|
||||||
|
}
|
||||||
return resp.data as Config;
|
return resp.data as Config;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(
|
console.error(
|
||||||
|
|
Loading…
Reference in New Issue