Skip to content

Commit

Permalink
Removed som unused code and set screen to update fiat value each minuteg
Browse files Browse the repository at this point in the history
  • Loading branch information
f-r00t committed Feb 26, 2024
1 parent 86bcc6c commit 17c6a3e
Showing 1 changed file with 8 additions and 46 deletions.
54 changes: 8 additions & 46 deletions src/MainScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ async function init(navigation) {
if (Globals.checkIfStuck === undefined) {
Globals.checkIfStuck = setInterval(checkIfStuck, 5000);
}


/* Use our native C++ func to process blocks, provided we're on android */
/* TODO: iOS support */
Expand Down Expand Up @@ -339,12 +340,11 @@ export class MainScreen extends React.PureComponent {

async updateBalance() {

if (Globals.coinPrice == 0) {
const tmpPrice = await getCoinPriceFromAPI();

if (tmpPrice !== undefined) {
Globals.coinPrice = tmpPrice;
}
const tmpPrice = await getCoinPriceFromAPI();

if (tmpPrice !== undefined) {
Globals.coinPrice = tmpPrice;
}

const unreads = await getUnreadMessages();
Expand Down Expand Up @@ -411,25 +411,10 @@ export class MainScreen extends React.PureComponent {
initBackgroundSync();
let flipFlop = false;

let keepAnimating = () => {

Animated.timing(this.animatedValue, {
toValue: flipFlop ? 0 : 224,
duration: 30000
}).start(() => {
flipFlop = flipFlop ? false : true;
keepAnimating();
});

}

Animated.timing(this.animatedValue, {
toValue: 224,
duration: 30000
}).start(() => {
keepAnimating();
setInterval(async () => {
this.updateBalance();
}, 60000);

});
}

componentWillUnmount() {
Expand Down Expand Up @@ -805,47 +790,24 @@ class BalanceComponentNoTranslation extends React.Component {
expandedBalance: false,
};

// this.animation = new Animated.Value(0);

this.balanceRef = (ref) => this.balance = ref;
this.valueRef = (ref) => this.value = ref;
}


componentWillMount() {
// this.animatedValue = new Animated.Value(0);
}


componentDidMount() {

let flipFlop = false;

// let keepAnimating = () => {

// Animated.timing(this.animatedValue, {
// toValue: flipFlop ? 0 : 224,
// duration: 10000
// }).start(() => {
// flipFlop = flipFlop ? false : true;
// keepAnimating();
// });

// }

// Animated.timing(this.animatedValue, {
// toValue: 224,
// duration: 10000
// }).start(() => {
// keepAnimating();

// });
}

componentWillReceiveProps(nextProps) {
if (nextProps.unlockedBalance !== this.props.unlockedBalance ||
nextProps.lockedBalance !== this.props.lockedBalance) {
// this.balance.bounce(800);
}
}

Expand Down

0 comments on commit 17c6a3e

Please sign in to comment.