mirror of
https://github.com/PeWu/topola-viewer.git
synced 2025-12-23 18:50:04 +00:00
Replaced axios with fetch(). Added one more polyfill.
IE11 still does not work.
This commit is contained in:
parent
cb2fad4fcd
commit
e1ba96296a
@ -3,7 +3,7 @@
|
||||
"version": "1.0.0",
|
||||
"main": "src/index.tsx",
|
||||
"dependencies": {
|
||||
"axios": "^0.18.0",
|
||||
"array.prototype.find": "^2.0.4",
|
||||
"d3": "^5.7.0",
|
||||
"history": "^4.7.2",
|
||||
"md5": "^2.2.1",
|
||||
|
||||
@ -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';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user