Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Book 820 - Save Preference (Exchange, Sportsbook) #30

Open
wants to merge 598 commits into
base: BOOK-769-Sportsbook
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
598 commits
Select commit Hold shift + click to select a range
72520c3
Merge pull request #89 from PBSA/BOOK-880-TransactionHistory-Fund-for…
mseaward Sep 17, 2018
88acc09
Merge pull request #88 from PBSA/BOOK-879-incorrect-export-file-date-…
mseaward Sep 17, 2018
9defff2
Added conditional to account for 'today' instances and only act on th…
mseaward Sep 17, 2018
c01bc89
Merge pull request #90 from PBSA/BOOK-879-incorrect-export-file-date-…
mseaward Sep 17, 2018
d0b3836
1.2.6
mseaward Sep 17, 2018
9d77be2
1.2.7
mseaward Sep 17, 2018
3aa2109
1.2.8
mseaward Sep 17, 2018
3d90bcc
Make release package-lock.json match develops.
mseaward Sep 17, 2018
8168e92
1.2.9
mseaward Sep 17, 2018
b4ea13b
Simplified/corrected data handling.
mseaward Sep 17, 2018
2a96d26
Enhanced readability of variable declaration.
mseaward Sep 17, 2018
fb59d2a
Corrected typo in documentation comments.
mseaward Sep 17, 2018
93e2f7b
Added some comments to help understand data array.
mseaward Sep 17, 2018
438e3a5
Enhanced prior comment added.
mseaward Sep 17, 2018
9d7da92
Merge pull request #81 from PBSA/BOOK-864-Change-naming-of-tab-to-ope…
mseaward Sep 18, 2018
7ab5a93
Simplified and corrected the lifecycle of the new CommonMessage compo…
mseaward Sep 18, 2018
aae5a7d
Added a new mesage type: none.
mseaward Sep 18, 2018
7f3614a
Test styles for smoother slide down
mseaward Sep 18, 2018
b9ed6a7
testting
mseaward Sep 18, 2018
898a587
Fix logic that determines if a decimal is or is not allowed in the od…
mseaward Sep 18, 2018
a5ead57
Updates to colors of message module.
mseaward Sep 19, 2018
08a8a9e
Implementation on exchange
mseaward Sep 19, 2018
1723b66
Exchange page implementation.
mseaward Sep 19, 2018
0fd7109
Shortened animation to 1/2 second.
mseaward Sep 19, 2018
f20219d
Removed commonMessage component test display from app.jsx
mseaward Sep 19, 2018
9c0f4e6
Remove unused code.
mseaward Sep 19, 2018
29d97ef
Remove console.log
mseaward Sep 19, 2018
a2ed1a8
Adjust height of message component.
mseaward Sep 19, 2018
7a7d485
Declare variable on new line.
mseaward Sep 19, 2018
77b03d8
Currently broken test code for altering a bet.
mseaward Sep 19, 2018
6d33c99
Removed code that would specify stake field as dust when non whole nu…
mseaward Sep 19, 2018
b2ef340
Updated comment to reflect tab name change.
mseaward Sep 19, 2018
2b3b937
Merge pull request #91 from PBSA/BOOK-883-fractions-in-stake-treated-…
KeeganPBSA Sep 19, 2018
db0fc49
1.2.10
mseaward Sep 19, 2018
fc34d66
Repair dust check:
mseaward Sep 19, 2018
74ce630
Account for rounding on fractional stake values.
mseaward Sep 19, 2018
cc0a150
Account for rounding of stak values on base coin currency mode(btf).
mseaward Sep 19, 2018
7e9bb39
Merge branch 'release' of github.com:PBSA/bookie into release
mseaward Sep 20, 2018
7ea39ce
Fixed issue where the user was unabel to navigate to the MyBets page.
KeeganPBSA Sep 20, 2018
df0f668
Merge branch 'release' of https://github.com/PBSA/bookie into release
KeeganPBSA Sep 20, 2018
a050079
Merge pull request #92 from PBSA/BOOK-883-fractions-in-stake-treated-…
KeeganPBSA Sep 20, 2018
6683c73
Merge branch 'release' of https://github.com/PBSA/bookie into release
KeeganPBSA Sep 20, 2018
6c24d3b
Merge branch 'release' of github.com:PBSA/bookie into release
mseaward Sep 20, 2018
7a03044
Modify to check toa ccount for future rounding of numbers.
mseaward Sep 20, 2018
7c6fa0b
Merge branch 'release' of https://github.com/PBSA/bookie into release
KeeganPBSA Sep 20, 2018
41190a8
Modify to check toa ccount for future rounding of numbers.
mseaward Sep 20, 2018
aed654d
}
mseaward Sep 20, 2018
b8d4e6b
Merge remote-tracking branch 'origin/release' into BOOK-883-fractions…
mseaward Sep 20, 2018
1b14aae
Add code to handle scientific notation amounts.
mseaward Sep 20, 2018
cfa9081
Merge remote-tracking branch 'origin/release' into BOOK-883-fractions…
mseaward Sep 20, 2018
18671ba
Remove old code.
mseaward Sep 20, 2018
a4662ef
Test/In Progress code for advanced messaging component support.
mseaward Sep 21, 2018
1f9b49c
Merge pull request #93 from PBSA/BOOK-883-fractions-in-stake-treated-…
mseaward Sep 21, 2018
642cdb2
Update version to 1.2.11
mseaward Sep 21, 2018
5006531
Merge branch 'release' of github.com:PBSA/bookie into release
mseaward Sep 21, 2018
70b2ea0
Modified CommonMessage component to use state loading of messages.
mseaward Sep 21, 2018
0451ad3
Simplified the rendering process for the two, currently known, locati…
mseaward Sep 21, 2018
24aabac
Added reducer/action functions for adding new messages.
mseaward Sep 21, 2018
b639669
Implemented dynamic styling based on number of messages that exist ab…
mseaward Sep 24, 2018
a1bca86
Modified the rendering location of the commone message component.
mseaward Sep 24, 2018
925412d
Modified test data.
mseaward Sep 24, 2018
4b1ce47
Added core files.
mseaward Sep 24, 2018
c1506e5
Set the default state of the messages to null.
mseaward Sep 24, 2018
71d9f4a
Changed styling to be a hubrid of BEMIT.
mseaward Sep 25, 2018
9fdf354
BOOK-1083
KeeganPBSA Sep 25, 2018
071d6f1
First deep pass over currencyUtils
KeeganPBSA Sep 25, 2018
2420fa1
Fixed issue with logging in and infinite values, as well as the simpl…
KeeganPBSA Sep 25, 2018
f661354
Randomly generated messages and message types on redirect. (for testi…
mseaward Sep 25, 2018
1171f5b
Cleaned up two files
KeeganPBSA Sep 26, 2018
c7c04b3
Removed all files and references to Landing Page
imarquette Sep 26, 2018
4b0463b
BOOK-1083
KeeganPBSA Sep 26, 2018
5d929d0
Added actionWhitelist config
mseaward Sep 26, 2018
24b7992
Fixed filters for redux-dev-tool inspector
mseaward Sep 26, 2018
0d16584
Fixed references to old placed bets to open bets
mseaward Sep 26, 2018
c57daa7
BOOK-1083
KeeganPBSA Sep 26, 2018
b2f79ea
BOOK-1083
KeeganPBSA Sep 26, 2018
51d0a64
BOOK-1083
KeeganPBSA Sep 26, 2018
47f42e7
Removed custom function for dispatch in favor of advanced dispatch me…
mseaward Sep 26, 2018
5dba1ba
BOOK-1083
KeeganPBSA Sep 26, 2018
c20069d
Fixed balance not showing mCoin equivalent.
mseaward Sep 26, 2018
ec3a816
Fixed minimum bet on BTF currency mode.
mseaward Sep 26, 2018
3472bba
Merge branch 'BOOK-1083-release-merge' of github.com:PBSA/bookie into…
mseaward Sep 26, 2018
868323f
Resolve mixed code another commit.
mseaward Sep 26, 2018
8ee8470
Altered the minimum amounts for bets.
mseaward Sep 27, 2018
0e63ced
Revert function call as fix is inside said function.
mseaward Sep 27, 2018
24aa38f
Incrementing either stake or odds to a point where their respective v…
mseaward Sep 27, 2018
43edd03
BOOK-1083
KeeganPBSA Sep 27, 2018
8bcc3bb
Merge branch 'BOOK-1083-release-merge' of https://github.com/PBSA/boo…
KeeganPBSA Sep 27, 2018
fffd2c5
Updating README with proper instructions.
andypbsa Sep 27, 2018
6cdf72c
Repair loading modal styling after logging in.
mseaward Sep 27, 2018
a44089f
Remove unecessary element tagging.
mseaward Sep 27, 2018
6fe5f4c
Repair styling on my-bets when cancelling a bet or bets.
mseaward Sep 27, 2018
c211758
Merge pull request #95 from PBSA/BOOK-1083-release-merge
KeeganPBSA Sep 27, 2018
fb8727e
Merge remote-tracking branch 'origin/develop' into BOOK-856-change-na…
mseaward Sep 27, 2018
042145d
Merge remote-tracking branch 'origin/develop' into BOOK-869-common-me…
mseaward Sep 27, 2018
0d0583e
Merge remote-tracking branch 'origin/develop' into BOOK-869-common-me…
mseaward Sep 27, 2018
6487673
Merge remote-tracking branch 'origin/develop' into BOOK-848-edit-bet-…
mseaward Sep 27, 2018
3fe81ff
Anytime odds is changed, the bet is cancelled and a new one is placed.
mseaward Sep 27, 2018
8ec1034
Merge pull request #82 from PBSA/BOOK-865-the-betslip-should-default-…
mseaward Sep 28, 2018
83ead3a
Modify the display of offers in the simple betting widget such that t…
mseaward Sep 28, 2018
ef09104
Adjust styling of simple betting widget.
mseaward Sep 28, 2018
e440f0c
Adjust styling again
mseaward Sep 28, 2018
5397cee
Change the tab when clicking to make a new unplaced bet.
mseaward Sep 28, 2018
ab544b8
Change comment to coincide with previosu commit.
mseaward Sep 28, 2018
44eb8b4
Repair reversed setting that dynamically change the current market dr…
mseaward Sep 28, 2018
609a06f
Fix typo and merge conflict.
mseaward Sep 28, 2018
966be60
Merge pull request #84 from PBSA/BOOK-856-change-naming-of-tab-to-pla…
mseaward Oct 2, 2018
0b20888
Remove a TODO that was missed due to a typo.
mseaward Oct 4, 2018
c34b393
Added code for checkint if the betslip footer is presently visible in…
mseaward Oct 4, 2018
6ce1eb4
BOOK-1107
KeeganPBSA Oct 4, 2018
96b594e
Disable clicking on "disabled" event cells on the simple betting widget.
mseaward Oct 4, 2018
ac9239d
Removed hover cursor from disabled row cells.
mseaward Oct 4, 2018
f45ca1b
Cleaned up the isDisabled function to have consistent return types.
mseaward Oct 4, 2018
265c4ae
Merge pull request #98 from PBSA/BOOK-885-post-login-popup-and-my_bet…
mseaward Oct 4, 2018
41552f2
Changed rowClassName to empty string as per their spec.
mseaward Oct 4, 2018
e5ad3e8
Changed instance of classname to match the open bets renaming to re-e…
mseaward Oct 4, 2018
5c33c09
Merge remote-tracking branch 'origin/develop' into BOOK-825-Bet-field…
mseaward Oct 10, 2018
c1d911d
Modified styling of cells.
mseaward Oct 10, 2018
efee337
Remove console logs
mseaward Oct 10, 2018
266978d
Modify the algorithm for checking the location of the footer div base…
mseaward Oct 11, 2018
31812cc
Use destructuring for assigning amounts from the bet difference varia…
mseaward Oct 11, 2018
935f636
Merge remote-tracking branch 'origin/develop' into BOOK-1107-bets-not…
mseaward Oct 11, 2018
c093afd
Comment added to clarify the convoluted hasOffers function.
mseaward Oct 11, 2018
92762e9
Simplify check of null/falsey
mseaward Oct 11, 2018
aaad0eb
Change while loop to use a for loop with cached offers map size.
mseaward Oct 11, 2018
e3dfa8e
Timer modifications.
mseaward Oct 15, 2018
505ae35
Timer optimization.
mseaward Oct 15, 2018
40805e5
Optimizations made to message deletion and props diff checking.
mseaward Oct 15, 2018
2c9c00b
Merge remote-tracking branch 'origin/develop' into BOOK-869-common-me…
mseaward Oct 15, 2018
ad16495
Adjusted dynamic positioning of the place bet footer element.
mseaward Oct 15, 2018
05b8283
Update event listener to handle window resize.
mseaward Oct 15, 2018
586454f
Merge remote-tracking branch 'origin/develop' into BOOK-847-Add-total…
mseaward Oct 15, 2018
ce22935
Merge pull request #102 from PBSA/BOOK-1106-scroll-bar-missing-from-o…
mseaward Oct 16, 2018
8b1793b
Merge pull request #99 from PBSA/BOOK-825-Bet-fields-bet-tables-are-n…
mseaward Oct 16, 2018
a66a774
Merge remote-tracking branch 'origin/develop' into BOOK-1107-bets-not…
mseaward Oct 16, 2018
0543845
Merge pull request #101 from PBSA/BOOK-1107-bets-not-showing
mseaward Oct 16, 2018
43820c9
1.2.12
mseaward Oct 25, 2018
16d281d
1.2.13
mseaward Oct 25, 2018
3f74ca5
Update api endpoints
mseaward Oct 25, 2018
4748986
1.2.14
mseaward Oct 26, 2018
475f412
Merge pull request #87 from PBSA/BOOK-848-edit-bet-then-it-should-onl…
mseaward Nov 7, 2018
5c249a2
Merge pull request #97 from PBSA/BOOK-869-common-messaging-module
mseaward Nov 7, 2018
7bfe2a8
Merge remote-tracking branch 'origin/develop' into BOOK-745-Unable-to…
mseaward Nov 7, 2018
ff8e2de
Implement error messaging in the quickbetdrawer and the placed bets tab.
mseaward Nov 8, 2018
ffad306
Modify the algorithm to determine what the message type is as opposed…
mseaward Nov 8, 2018
6a64498
Update beatrice information
mseaward Nov 8, 2018
6e199ca
Update endpoint connection information
mseaward Nov 8, 2018
87301c5
Change the default testnet to elizabeth.
mseaward Nov 8, 2018
01a1d24
Update console log output to be more variable change friendly.
mseaward Nov 8, 2018
7c00c1b
Update variable use in console messages to be uniform.
mseaward Nov 8, 2018
8cc0f50
Merge remote-tracking branch 'origin/develop' into BOOK-1114-update-c…
mseaward Nov 8, 2018
af1093d
Updated beatrice faucet URL
mseaward Nov 8, 2018
628fcf6
Update api endpoint for beatrice.
mseaward Nov 9, 2018
ee0679f
remove debugger
mseaward Nov 9, 2018
0e66c67
Modify accountservice to handle differing api endpoints.
mseaward Nov 9, 2018
1bfd7b2
Merge pull request #105 from PBSA/BOOK-1114-update-config.js-with-new…
mseaward Nov 9, 2018
f540022
Update connections
mseaward Nov 9, 2018
cf4aee4
Update connections.
mseaward Nov 9, 2018
15d55a4
Merge branch 'develop' into release
mseaward Nov 9, 2018
ae013fe
Merge pull request #106 from PBSA/release
mseaward Nov 13, 2018
28fac38
Add eifos witness endpoint
mseaward Nov 13, 2018
9e4cb14
Merge pull request #108 from PBSA/add-eifos-witness
mseaward Nov 13, 2018
10fe314
Implement variable place bet button location for the complex betting …
mseaward Nov 13, 2018
d31cbf4
Move DOM manipulation functions to utility file.
mseaward Nov 14, 2018
31cc29d
Merge branch 'develop' into BOOK-847-Add-total-liability-field-in-Pla…
mseaward Nov 14, 2018
ced43f9
Merge pull request #96 from PBSA/BOOK-829-landing-page
mseaward Nov 16, 2018
e3a343f
Merge branch 'develop' into BOOK-745-Unable-to-submit-betslip-when-on…
mseaward Nov 16, 2018
7dae9fd
Merge pull request #104 from PBSA/BOOK-745-Unable-to-submit-betslip-w…
mseaward Nov 16, 2018
dd2109e
Re-add the transaction fee to the bet confirmation modal.
mseaward Nov 16, 2018
965e44d
Merge branch 'develop' into BOOK-847-Add-total-liability-field-in-Pla…
mseaward Nov 16, 2018
278cdb1
Merge remote-tracking branch 'origin/develop' into BOOK-847-Add-total…
mseaward Nov 16, 2018
40a579e
Added boilerplate connection config
mseaward Nov 27, 2018
02393b3
1.2.15
mseaward Nov 27, 2018
b41c7a7
Update to use the public peerplaysjs libraries.
mseaward Nov 27, 2018
47ece27
Merge pull request #2 from PBSA/use-public-js-libraries
pbsa-github Nov 27, 2018
9f94d94
Update the .gitignore to exclude accidental changes to the blockchain…
mseaward Nov 28, 2018
23a1376
Merge pull request #4 from PBSA/update-gitignore
mseaward Nov 28, 2018
bae0902
cleanup ignored files
mseaward Nov 28, 2018
bb97fd3
Proceed with caution when tinkering with the config.js file.
mseaward Nov 28, 2018
9e57ee7
Create LICENSE
pbsa-github Nov 28, 2018
f10604c
BOOK-742: Cancel Bets Message
Dec 5, 2018
1a5c398
Added some function documentation.
mseaward Dec 5, 2018
7228508
Remove sensitive info
mseaward Dec 6, 2018
a053109
Merge remote-tracking branch 'public/develop' into BOOK-847-Add-total…
mseaward Dec 6, 2018
1152c57
remove config
mseaward Dec 6, 2018
e8848ef
Add config from develop
mseaward Dec 6, 2018
77de8f5
remove config
mseaward Dec 6, 2018
c9db122
Remove todos
mseaward Dec 7, 2018
b5a8ae1
- Add action/reducer for clearing messages.
MuffinLightning Feb 8, 2019
f037589
Added null check
MuffinLightning Feb 11, 2019
8822f45
Address timer issue. Most recent messages will be removed first.
MuffinLightning Mar 5, 2019
e8c61f2
Modify classnames to be abbreviated better.
MuffinLightning Mar 6, 2019
cff7c9c
Update the packages to use the pbsa peerplaysjs-lib and peerplaysjs-w…
mseaward Mar 6, 2019
289e86b
Fixed an issue where the bet cancellation notifications were appearin…
MuffinLightning Mar 7, 2019
169356b
Merge pull request #16 from PBSA/BOOK-1143-Common-Message-component-r…
mseaward Mar 8, 2019
3db083e
Merge pull request #1 from peerplays-network/update-peerplaysjs-libra…
mseaward Mar 9, 2019
588aa53
Merge branch 'develop' of github.com:peerplays-network/BookiePro into…
mseaward Mar 10, 2019
743435b
Merge pull request #2 from peerplays-network/network/develop
mseaward Mar 10, 2019
bcdac76
Merge pull request #12 from peerplays-network/BOOK-742
MuffinLightning Mar 12, 2019
c645282
Merge pull request #9 from peerplays-network/BOOK-794-cleanup-todos
mseaward Mar 14, 2019
b3da4c7
Move the filtering to the config to simplify modification to the filt…
mseaward Dec 7, 2018
178a904
Remove unused variable.
mseaward Mar 14, 2019
c9b6126
Ignore config.js changes
mseaward Mar 15, 2019
ee93cee
Update to new peerplays-network repo location
mseaward Mar 15, 2019
7c7f01c
Update library urls
MuffinLightning Mar 18, 2019
9b7a73c
Merge branch 'develop' into BOOK-1135-Missing-history
MuffinLightning Mar 22, 2019
c297d30
Merge pull request #15 from peerplays-network/BOOK-1135-Missing-history
MuffinLightning Mar 22, 2019
c9dcc14
Merge remote-tracking branch 'origin/develop' into BOOK-847-Add-total…
mseaward Mar 22, 2019
6cba0a0
Merge pull request #10 from peerplays-network/BOOK-847-Add-total-liab…
mseaward Mar 22, 2019
5350845
Merge pull request #19 from peerplays-network/BOOK-790-optimize-filte…
mseaward Mar 27, 2019
a076e83
Add storage util files
MuffinLightning Apr 1, 2019
c3f4382
Init
MuffinLightning Apr 1, 2019
9263d25
Fixed data fetching in Sportsbook.jsx
MuffinLightning Apr 2, 2019
9f38c8e
Some cleanup
MuffinLightning Apr 2, 2019
af770a2
Cleanup dispatch getData
mamokin Apr 4, 2019
b73d7dd
Use config constant for max events.
MuffinLightning Apr 4, 2019
322cf9e
commitlint and commitizen
mamokin Apr 4, 2019
2d94bcc
ci(.huskyrc.json): husky hooks
mamokin Apr 4, 2019
a025620
docs(readme.md, package.json): updated readme
mamokin Apr 4, 2019
199c95c
chore(release): 1.2.16
mamokin Apr 4, 2019
b21684d
docs(readme.md): add labels
mamokin Apr 4, 2019
4f689be
chore(release): 1.2.17
mamokin Apr 4, 2019
fb640e0
chore(release): 1.2.16
mamokin Apr 4, 2019
b8191d2
docs(changelog.md): remove prematurely added changelog
mamokin Apr 4, 2019
57e9f82
Update README.md
mseaward Apr 5, 2019
015feae
docs(package.json, readme.md): update scripts
mamokin Apr 5, 2019
c13729d
Update README.md
mseaward Apr 5, 2019
6352a91
Update package.json
mseaward Apr 5, 2019
89fb988
Added the sportsbook toggle fix to this branch
MuffinLightning Apr 5, 2019
ed674c7
Merge branch 'BOOK-769-Sportsbook' into BOOK-820-Save-Preference
MuffinLightning Apr 5, 2019
d74695d
Merge pull request #34 from peerplays-network/BOOK-1186
mseaward Apr 5, 2019
30433e6
build: moved build process back into repo
mamokin Apr 5, 2019
c852af6
chore(release): 1.2.17
mamokin Apr 5, 2019
81b47eb
refactor(electron.js): move electron file to root
mamokin Apr 8, 2019
3ba51c2
build: update scripts
mamokin Apr 8, 2019
80f9e20
Merge pull request #36 from peerplays-network/BOOK-1181
mseaward Apr 8, 2019
e346da1
Merge branch 'pbsa-develop' into BOOK-769-Update-1
MuffinLightning Apr 10, 2019
2900709
Update version
MuffinLightning Apr 10, 2019
813f30c
Update lock file
MuffinLightning Apr 10, 2019
9ba992e
Merge pull request #39 from peerplays-network/BOOK-769-Update-1
mseaward Apr 10, 2019
e076115
Add storage util files
MuffinLightning Apr 1, 2019
d1a900b
Init
MuffinLightning Apr 1, 2019
1ba16ae
Fixed data fetching in Sportsbook.jsx
MuffinLightning Apr 2, 2019
eb95748
Some cleanup
MuffinLightning Apr 2, 2019
e5edf13
Cleanup dispatch getData
mamokin Apr 4, 2019
2b616cb
Use config constant for max events.
MuffinLightning Apr 4, 2019
9a4ef87
Added the sportsbook toggle fix to this branch
MuffinLightning Apr 5, 2019
7325623
chore(release): 1.3.0-sportsbook.2
mamokin Apr 10, 2019
d893690
Merge branch 'BOOK-820-Save-Preference' of github.com:peerplays-netwo…
mamokin Apr 10, 2019
013de95
refactor(electron-builder.yaml): update app name
mamokin Apr 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/actions/AuthActions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {LoadingStatus, ActionTypes, Config} from '../constants';
import {LoadingStatus, ActionTypes, Config, BookieModes} from '../constants';
import {
CommunicationService,
KeyGeneratorService,
Expand All @@ -22,6 +22,7 @@ import {TransactionBuilder, ChainTypes} from 'peerplaysjs-lib';
import {SoftwareUpdateActions} from '.';
import Immutable from 'immutable';
import AllSportsActions from './AllSportsActions';
import StorageUtils from '../utility/StorageUtils';

const ACCOUNT_UPDATE = `${ChainTypes.reserved_spaces.protocol_ids}.${ChainTypes.operations.account_update}`; // eslint-disable-line

Expand Down Expand Up @@ -177,7 +178,14 @@ class AuthActions {
.then(() => {
log.debug('Login succeed.');
// Navigate to home page
dispatch(NavigateActions.navigateTo('/exchange'));
const mode = StorageUtils.getBookMode();

if (mode === BookieModes.SPORTSBOOK) {
dispatch(NavigateActions.navigateTo('/sportsbook'));
} else {
dispatch(NavigateActions.navigateTo('/exchange'));
}

// Set login status to done
dispatch(AuthPrivateActions.setLoginLoadingStatusAction(LoadingStatus.DONE));
})
Expand Down
16 changes: 12 additions & 4 deletions src/components/AllSports/AllSports.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import {AllSportsSelector, QuickBetDrawerSelector} from '../../selectors';
import PeerPlaysLogo from '../PeerPlaysLogo';
import {DateUtils} from '../../utility';
import Loading from '../Loading';
import {bindActionCreators} from 'redux';
import {Config} from '../../constants';

const MAX_EVENTS_PER_WIDGET = 3;
const {getData} = AllSportsActions;
const MAX_EVENTS_PER_WIDGET = Config.maxEvents;

class AllSports extends PureComponent {
componentDidMount() {
this.props.dispatch(getData());
this.props.getData();
}

render() {
Expand Down Expand Up @@ -61,4 +62,11 @@ const mapStateToProps = (state) => ({
canCreateBet: QuickBetDrawerSelector.canAcceptBet(state)
});

export default connect(mapStateToProps)(AllSports);
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
getData: AllSportsActions.getData
},
dispatch
);

export default connect(mapStateToProps, mapDispatchToProps)(AllSports);
4 changes: 4 additions & 0 deletions src/components/App/TitleBar/SportsbookToggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {I18n} from 'react-redux-i18n';
import {BookieModes} from '../../../constants';
import {EventPageSelector} from '../../../selectors';
import {ChainTypes} from 'peerplaysjs-lib';
import StorageUtils from '../../../utility/StorageUtils';
import StorageItems from '../../../constants/StorageItems';

class SportsbookToggle extends PureComponent {
constructor(props) {
Expand All @@ -27,6 +29,8 @@ class SportsbookToggle extends PureComponent {
subroute = '/BettingMarketGroup/' + this.props.bmgID;
}

StorageUtils.set(StorageItems.BOOKIE_MODE_PREFERENCE, mode);

switch (mode) {
case BookieModes.EXCHANGE: {
this.props.setMode(BookieModes.EXCHANGE);
Expand Down
22 changes: 12 additions & 10 deletions src/components/SportsBook/SportsBook.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ import {bindActionCreators} from 'redux';
import {BackingWidgetContainer} from '../BettingWidgets';
import {EventPageSelector} from '../../selectors';
import {ObjectUtils, SportsbookUtils} from '../../utility';
import {NavigateActions} from '../../actions';

const MAX_EVENTS = 3;
import {NavigateActions, AllSportsActions} from '../../actions';
import {Config} from '../../constants';

class SportsBook extends PureComponent {
render() {

componentDidMount() {
this.props.getData();
}

render() {
return (
<div className='all-sports-wrapper'>
<div className='banner-ad-header' />
{
this.props.allSports.map((sport) => {

const events = sport.get('events');

let eventsToDisplay = [];

events && events.slice(0, MAX_EVENTS).forEach((e) => {

events && events.slice(0, Config.maxEvents).forEach((e) => {
let bmgs = e.get('bettingMarketGroups');

if(bmgs) {
if (bmgs) {
let bmg = bmgs.first();

if (bmg && SportsbookUtils.hasBettingMarkets(bmg)) {
Expand Down Expand Up @@ -78,9 +78,11 @@ const mapStateToProps = (state, ownProps) => {

const mapDispatchToProps = (dispatch) => bindActionCreators(
{
navigateTo: NavigateActions.navigateTo
navigateTo: NavigateActions.navigateTo,
getData: AllSportsActions.getData
},
dispatch
);


export default connect(mapStateToProps, mapDispatchToProps)(SportsBook);
1 change: 1 addition & 0 deletions src/constants/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const Config = {
hardUpdateGracePeriod: 43200, // 12 Hour Hard-Update Grace Period
coinTransactionFee: 0.00001,
mCoinTransactionFee: 0.01,
maxEvents: 3,
broadcastAccount: {
name: process.env.accounts.broadcasts.name,
keys: {
Expand Down
5 changes: 5 additions & 0 deletions src/constants/StorageItems.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const StorageItems = {
BOOKIE_MODE_PREFERENCE: 'BOOKIE_MODE_PREFERENCE',
};

export default StorageItems;
7 changes: 3 additions & 4 deletions src/reducers/AppReducer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {ActionTypes, LoadingStatus, ConnectionStatus, AppBackgroundTypes,
BookieModes} from '../constants';
import {ActionTypes, LoadingStatus, ConnectionStatus, AppBackgroundTypes} from '../constants';
import Immutable from 'immutable';
import StorageUtils from '../utility/StorageUtils';

const initialState = Immutable.fromJS({
appBackgroundType: AppBackgroundTypes.GRADIENT_BG,
Expand All @@ -18,8 +18,7 @@ const initialState = Immutable.fromJS({
isTitleBarTransparent: true,
gatewayAccount: {},
showLicenseScreen: false,
bookMode: BookieModes.EXCHANGE,

bookMode: StorageUtils.getBookMode(),
});

export default function(state = initialState, action) {
Expand Down
38 changes: 38 additions & 0 deletions src/utility/StorageUtils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
let ls = window.localStorage;
import BookieModes from '../constants/BookieModes';
import StorageItems from '../constants/StorageItems';

/**
* Base Storage service
*
* Used to interact with the browser's local storage.
*/
class StorageUtils {
// Generic storage get
static get(key) {
return ls.getItem(key);
}

static set(key, value) {
return ls.setItem(key, value);
}

static remove(key) {
return ls.removeItem(key);
}

// Get Bookie Mode from LS - has some extra logic to avoid invalid values
static getBookMode() {
const mode = ls.getItem(StorageItems.BOOKIE_MODE_PREFERENCE);

if (mode === BookieModes.EXCHANGE || mode === BookieModes.SPORTSBOOK) {
return mode;
} else {
return BookieModes.EXCHANGE;
}

}

}

export default StorageUtils;