mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-03-10 09:33:47 +00:00
Replaced axios with fetch(). Added one more polyfill.
IE11 still does not work.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import * as queryString from 'query-string';
|
||||
import * as React from 'react';
|
||||
import axios from 'axios';
|
||||
import md5 from 'md5';
|
||||
import {Chart} from './chart';
|
||||
import {convertGedcom} from './gedcom_util';
|
||||
@@ -103,11 +102,16 @@ export class ChartView extends React.Component<RouteComponentProps, State> {
|
||||
? 'https://cors-anywhere.herokuapp.com/' + url
|
||||
: url;
|
||||
|
||||
axios
|
||||
.get(urlToFetch)
|
||||
.then((response) =>
|
||||
window.fetch(urlToFetch)
|
||||
.then((response) => {
|
||||
if (response.status !== 200) {
|
||||
return Promise.reject(new Error(response.statusText));
|
||||
}
|
||||
return response.text();
|
||||
})
|
||||
.then((data) =>
|
||||
this.setGedcom({
|
||||
gedcom: response.data,
|
||||
gedcom: data,
|
||||
url,
|
||||
indi: options.indi,
|
||||
generation: options.generation,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'react-app-polyfill/ie11';
|
||||
import 'string.prototype.startswith';
|
||||
import 'array.prototype.find';
|
||||
import * as locale_en from 'react-intl/locale-data/en';
|
||||
import * as locale_pl from 'react-intl/locale-data/pl';
|
||||
import * as React from 'react';
|
||||
|
||||
Reference in New Issue
Block a user