commit
f51201a787
|
@ -58,13 +58,19 @@ function Compose({
|
||||||
).info;
|
).info;
|
||||||
|
|
||||||
const configuration = useMemo(() => {
|
const configuration = useMemo(() => {
|
||||||
const instances = store.local.getJSON('instances');
|
try {
|
||||||
const currentInstance = accounts.find(
|
const instances = store.local.getJSON('instances');
|
||||||
(a) => a.info.id === currentAccount,
|
const currentInstance = accounts.find(
|
||||||
).instanceURL;
|
(a) => a.info.id === currentAccount,
|
||||||
const config = instances[currentInstance].configuration;
|
).instanceURL;
|
||||||
console.log(config);
|
const config = instances[currentInstance].configuration;
|
||||||
return config;
|
console.log(config);
|
||||||
|
return config;
|
||||||
|
} catch (e) {
|
||||||
|
alert('Failed to load instance configuration. Please try again.');
|
||||||
|
console.error(e);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
|
@ -953,7 +953,7 @@ function Poll({ poll, readOnly, onUpdate = () => {} }) {
|
||||||
setUIState('loading');
|
setUIState('loading');
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const pollResponse = await masto.v1.poll.fetch(id);
|
const pollResponse = await masto.v1.polls.fetch(id);
|
||||||
onUpdate(pollResponse);
|
onUpdate(pollResponse);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Silent fail
|
// Silent fail
|
||||||
|
@ -1038,7 +1038,7 @@ function Poll({ poll, readOnly, onUpdate = () => {} }) {
|
||||||
});
|
});
|
||||||
console.log(votes);
|
console.log(votes);
|
||||||
setUIState('loading');
|
setUIState('loading');
|
||||||
const pollResponse = await masto.v1.poll.vote(id, {
|
const pollResponse = await masto.v1.polls.vote(id, {
|
||||||
choices: votes,
|
choices: votes,
|
||||||
});
|
});
|
||||||
console.log(pollResponse);
|
console.log(pollResponse);
|
||||||
|
@ -1087,7 +1087,7 @@ function Poll({ poll, readOnly, onUpdate = () => {} }) {
|
||||||
setUIState('loading');
|
setUIState('loading');
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const pollResponse = await masto.v1.poll.fetch(id);
|
const pollResponse = await masto.v1.polls.fetch(id);
|
||||||
onUpdate(pollResponse);
|
onUpdate(pollResponse);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Silent fail
|
// Silent fail
|
||||||
|
|
Loading…
Reference in a new issue