mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 06:43:24 +00:00
orbis fixes
This commit is contained in:
@@ -113,9 +113,9 @@ export default class Coriolis extends React.Component {
|
|||||||
|
|
||||||
async _getAnnouncements() {
|
async _getAnnouncements() {
|
||||||
try {
|
try {
|
||||||
const announces = await request.get('https://orbis.zone/api/announcement')
|
const announces = await request.get('https://api.orbis.zone/announcements')
|
||||||
.query({ showInCoriolis: true });
|
.query({ coriolis: true });
|
||||||
this.setState({ announcements: announces.body });
|
this.setState({ announcements: announces });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -426,7 +426,10 @@ export default class Header extends TranslatedComponent {
|
|||||||
if (this.props.announcements) {
|
if (this.props.announcements) {
|
||||||
announcements = [];
|
announcements = [];
|
||||||
for (let announce of this.props.announcements) {
|
for (let announce of this.props.announcements) {
|
||||||
announcements.push(<Announcement text={announce.message} />);
|
if (announce.expiry < Date.now()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
announcements.push(<Announcement text={announce.text} />);
|
||||||
announcements.push(<hr/>);
|
announcements.push(<hr/>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -686,13 +686,12 @@ export default class OutfittingPage extends Page {
|
|||||||
_genOrbis() {
|
_genOrbis() {
|
||||||
const data = {};
|
const data = {};
|
||||||
const ship = this.state.ship;
|
const ship = this.state.ship;
|
||||||
ship.coriolisId = ship.id;
|
|
||||||
data.coriolisShip = ship;
|
|
||||||
data.url = window.location.href;
|
|
||||||
data.title = this.state.buildName || ship.id;
|
data.title = this.state.buildName || ship.id;
|
||||||
data.description = this.state.buildName || ship.id;
|
data.description = this.state.buildName || ship.id;
|
||||||
data.ShipName = ship.id;
|
data.body = ship;
|
||||||
data.Ship = ship.id;
|
data.url = `https://coriolis.io${outfitURL(ship.id, ship.toString(), data.title)}`;
|
||||||
|
ship.type = ship.id;
|
||||||
|
|
||||||
console.log(data);
|
console.log(data);
|
||||||
this.context.showModal(<ModalOrbis ship={data} />);
|
this.context.showModal(<ModalOrbis ship={data} />);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ function orbisShorten(url, success, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const API_ORBIS = 'https://orbis.zone/api/builds/add';
|
const API_ORBIS = 'https://api.orbis.zone/ships';
|
||||||
/**
|
/**
|
||||||
* Upload to Orbis
|
* Upload to Orbis
|
||||||
* @param {object} ship The URL to shorten
|
* @param {object} ship The URL to shorten
|
||||||
|
|||||||
Reference in New Issue
Block a user