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