mirror of
https://github.com/filecoin-project/slate.git
synced 2024-09-19 18:28:03 +03:00
storage deals: override each time the user makes filecoin deal
This commit is contained in:
parent
f60b836b53
commit
3d64268058
@ -6,6 +6,8 @@ import * as Strings from "~/node_common/utilities";
|
||||
import * as Powergate from "~/node_common/powergate";
|
||||
import * as LibraryManager from "~/node_common/managers/library";
|
||||
|
||||
import { ffsOptions } from "@textile/powergate-client";
|
||||
|
||||
const initCORS = MW.init(MW.CORS);
|
||||
const initAuth = MW.init(MW.RequireCookieAuthentication);
|
||||
|
||||
@ -31,7 +33,10 @@ export default async (req, res) => {
|
||||
const PG = Powergate.get(user);
|
||||
let jobId;
|
||||
try {
|
||||
const Deal = await PG.ffs.pushStorageConfig(cid);
|
||||
const Deal = await PG.ffs.pushStorageConfig(
|
||||
cid,
|
||||
ffsOptions.withOverride(true)
|
||||
);
|
||||
jobId = Deal && Deal.jobId ? Deal.jobId : null;
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
|
@ -38,6 +38,7 @@ export default class SceneDeals extends React.Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
console.log(this.props);
|
||||
return (
|
||||
<ScenePage>
|
||||
<System.H1>Deals</System.H1>
|
||||
@ -49,23 +50,16 @@ export default class SceneDeals extends React.Component {
|
||||
{
|
||||
key: "address",
|
||||
name: "Address",
|
||||
width: "196px",
|
||||
width: "248px",
|
||||
},
|
||||
{
|
||||
key: "rootCid",
|
||||
name: "Root CID",
|
||||
width: "196px",
|
||||
},
|
||||
{
|
||||
key: "status",
|
||||
name: "Status",
|
||||
type: "STORAGE_DEAL_STATUS",
|
||||
width: "104px",
|
||||
width: "100%",
|
||||
},
|
||||
{
|
||||
key: "time",
|
||||
name: "Time",
|
||||
width: "100%",
|
||||
},
|
||||
],
|
||||
rows: this.props.viewer.storageList.map((each) => {
|
||||
@ -96,12 +90,11 @@ export default class SceneDeals extends React.Component {
|
||||
{
|
||||
key: "rootCid",
|
||||
name: "Root CID",
|
||||
width: "248px",
|
||||
width: "100%",
|
||||
},
|
||||
{
|
||||
key: "time",
|
||||
name: "Time",
|
||||
width: "100%",
|
||||
},
|
||||
],
|
||||
rows: this.props.viewer.retrievalList.map((each) => {
|
||||
|
@ -9,12 +9,12 @@ import { css } from "@emotion/react";
|
||||
import Section from "~/components/core/Section";
|
||||
import ScenePage from "~/components/core/ScenePage";
|
||||
|
||||
const POLLING_INTERVAL = 10000;
|
||||
|
||||
export default class SceneFilesFolder extends React.Component {
|
||||
_interval;
|
||||
|
||||
loop = async () => {
|
||||
console.log("checking");
|
||||
|
||||
let jobs = [];
|
||||
|
||||
this.props.viewer.library[0].children.forEach((d) => {
|
||||
@ -27,7 +27,7 @@ export default class SceneFilesFolder extends React.Component {
|
||||
}
|
||||
});
|
||||
|
||||
console.log(jobs);
|
||||
console.log({ jobs });
|
||||
|
||||
const response = await Actions.checkCIDStatus(jobs);
|
||||
|
||||
@ -35,11 +35,11 @@ export default class SceneFilesFolder extends React.Component {
|
||||
await this.props.onRehydrate();
|
||||
}
|
||||
|
||||
this._interval = window.setTimeout(this.loop, 5000);
|
||||
this._interval = window.setTimeout(this.loop, POLLING_INTERVAL);
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this._interval = window.setTimeout(this.loop, 5000);
|
||||
this.loop();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
Loading…
Reference in New Issue
Block a user