Skip to content

Commit fbd2432

Browse files
committed
Use babel presets
1 parent 6755f42 commit fbd2432

File tree

4 files changed

+17
-38
lines changed

4 files changed

+17
-38
lines changed

.babelrc

Lines changed: 0 additions & 30 deletions
This file was deleted.

babel.config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
"stage-2",
4+
"react"
5+
]
6+
}

src/axiosInstance.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
const axios = require("axios");
2-
3-
const constants = require("./constants");
1+
import axios from "axios";
2+
import {AUTH_KEY, IP_ADDRESS_KEY} from "./constants";
43

54
/**
65
* Global level axios configuration. These settings are automatically used in other places by using an axiosInstance instead of axios directly
@@ -15,9 +14,9 @@ export let axiosInstance = axios.create({
1514
*/
1615
axiosInstance.interceptors.request.use(
1716
config => {
18-
config.baseURL = localStorage.getItem(constants.IP_ADDRESS_KEY);
17+
config.baseURL = localStorage.getItem(IP_ADDRESS_KEY);
1918

20-
config.headers.Authorization = 'Basic ' + localStorage.getItem(constants.AUTH_KEY);
19+
config.headers.Authorization = 'Basic ' + localStorage.getItem(AUTH_KEY);
2120
return config;
2221
},
2322
error => Promise.reject(error)

src/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
const axiosInstance = require('./axiosInstance');
2-
const urls = require('./endpoint');
3-
const tools = require('./Tools')
1+
import {axiosInstance} from "./axiosInstance";
2+
import urls from "./endpoint";
3+
import {addColonAtLast, isLocalRemoteName} from "./Tools";
4+
5+
// const axiosInstance = require('./axiosInstance');
6+
// const urls = require('./endpoint');
7+
// const tools = require('./Tools')
48

59
/**
610
* getStats returns the current rclone stats.

0 commit comments

Comments
 (0)