more specific price seach should be working
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { WebviewTag } from 'electron';
|
||||
import * as _ from 'lodash';
|
||||
import React from 'react';
|
||||
import { ItemTextService } from '../services';
|
||||
import { PoeService } from '../services/poe.service';
|
||||
import { LoginWebview } from './login-webview';
|
||||
import { PriceListItem } from './price-list-item/price-list-item';
|
||||
@@ -44,9 +46,13 @@ export class Home extends React.Component<any, IState> {
|
||||
if (json === null || json['error']) {
|
||||
this.setState({ showLogin: true });
|
||||
} else if (json.items) {
|
||||
this.setState({ showLogin: false, data: json.items });
|
||||
this.getItemPrice(json.items, 0);
|
||||
console.log(json.items);
|
||||
const items = _.map(json.items, item => {
|
||||
item.fullText = ItemTextService.parseItem(item);
|
||||
return item;
|
||||
});
|
||||
|
||||
this.setState({ showLogin: false, data: items });
|
||||
this.getItemPrice(items, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,8 +66,10 @@ export class Home extends React.Component<any, IState> {
|
||||
return;
|
||||
}
|
||||
|
||||
const res = await PoeService.priceCheck(data[index].typeLine);
|
||||
if (res.currency_rec && res.min_price) {
|
||||
console.log(data[index]);
|
||||
console.log(data[index].fullText + '\n\n\n');
|
||||
const res = await PoeService.priceCheck(data[index].fullText);
|
||||
if ((res.min && res.currency) || (res.currency_rec && res.min_price)) {
|
||||
const dataCopy: any = [...data];
|
||||
dataCopy[index].priceInfo = res;
|
||||
await new Promise(resolve => this.setState({ data: dataCopy }, resolve));
|
||||
@@ -79,6 +87,10 @@ export class Home extends React.Component<any, IState> {
|
||||
public render() {
|
||||
const { data, showLogin } = this.state;
|
||||
|
||||
const url =
|
||||
'https://www.pathofexile.com/character-window/get-stash-items' +
|
||||
'?league=Incursion&tabs=1&tabIndex=0&accountName=DoctorCoctor';
|
||||
|
||||
return (
|
||||
<div style={{ padding: '20px' }}>
|
||||
{showLogin && <LoginWebview onSuccess={this.onLogin} />}
|
||||
@@ -88,7 +100,7 @@ export class Home extends React.Component<any, IState> {
|
||||
ref="webview"
|
||||
partition="persist:poe"
|
||||
preload="ipc-renderer.js"
|
||||
src="https://www.pathofexile.com/character-window/get-stash-items?league=Incursion&tabs=1&tabIndex=13&accountName=DoctorCoctor"
|
||||
src={url}
|
||||
style={{ opacity: 0, width: '0', height: '0' }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user