Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6e14843
Remove more get() from report action
tgolen Sep 2, 2020
b7d4b65
Remove some more instances of Ion.get()
tgolen Sep 2, 2020
d763455
Remove final instances of Ion.get()
tgolen Sep 2, 2020
97e4a8d
Switch this to merge
tgolen Sep 2, 2020
e180e6b
Connect to both keys at once
tgolen Sep 2, 2020
3c2e094
Merge branch 'master' into tgolen-remove-get-report
tgolen Sep 2, 2020
06bfe48
Correcting file after merge conflicts
tgolen Sep 2, 2020
9f3f432
Only keep track of the reportIDs that are known
tgolen Sep 3, 2020
de54b86
Only keep track of reportIDs
tgolen Sep 3, 2020
ceed33f
Properly handle missing report names
tgolen Sep 3, 2020
01d273d
Remove unnecessary prop for reportID
tgolen Sep 3, 2020
9acad6a
Handle unknown reports better
tgolen Sep 3, 2020
6de9289
Rename some of the ion keys so they follow conventions
tgolen Sep 3, 2020
5494c53
Rename from history to action
tgolen Sep 3, 2020
965f293
Rename history to actions
tgolen Sep 3, 2020
0982132
history renamed to action
tgolen Sep 3, 2020
ee9d9c1
Final round of renaming
tgolen Sep 3, 2020
bf89214
Remove currentReportActions and simplify promises
tgolen Sep 3, 2020
59911d9
Make the unread flag clear if you're looking at a chat when a comment…
tgolen Sep 3, 2020
2711ff3
Simplify more promise chains
tgolen Sep 4, 2020
2269a27
Merge branch 'master' into tgolen-remove-get-report
tgolen Sep 4, 2020
b166e5b
Correct merge issues and fix unread chats
tgolen Sep 4, 2020
71bb62c
Remove console log
tgolen Sep 4, 2020
efe4191
Remove unnecessary param and simplify the ion callback
tgolen Sep 4, 2020
a65eecb
Remove unnecessary comment
tgolen Sep 4, 2020
3441d79
Fix bad variables
tgolen Sep 4, 2020
884f9ba
camelcase the keys
tgolen Sep 4, 2020
5e2a96c
remove unnecessary variable and offset
tgolen Sep 4, 2020
7fc2e7e
Fix some unread bugs
tgolen Sep 4, 2020
f315341
Fixing several things from PR review
tgolen Sep 4, 2020
615503f
Merge branch 'master' into tgolen-remove-get-report
tgolen Sep 4, 2020
68871a2
Remove a history refernce
tgolen Sep 4, 2020
68596da
Adding debug info for notifications
tgolen Sep 4, 2020
d11b496
Shorten line
tgolen Sep 4, 2020
d9f3934
Merge branch 'master' into tgolen-remove-get-report
tgolen Sep 8, 2020
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
15 changes: 7 additions & 8 deletions src/IONKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
* This is a file containing constants for all the top level keys in our store
*/
export default {
ACTIVE_CLIENT_IDS: 'activeClientIDs',
APP_REDIRECT_TO: 'app_redirectTo',
CURRENT_URL: 'current_url',
ACTIVE_CLIENTS: 'activeClients',
APP_REDIRECT_TO: 'appRedirectTo',
CURRENT_URL: 'currentURL',
CREDENTIALS: 'credentials',
MY_PERSONAL_DETAILS: 'my_personal_details',
FIRST_REPORT_ID: 'firstReportID',
MY_PERSONAL_DETAILS: 'myPersonalDetails',
NETWORK: 'network',
PERSONAL_DETAILS: 'personal_details',
PERSONAL_DETAILS: 'personalDetails',
REPORT: 'report',
REPORT_ACTION: 'reportAction',
REPORT_HISTORY: 'report_history',
FIRST_REPORT_ID: 'first_report_id',
REPORT_ACTIONS: 'reportActions',
SESSION: 'session',
};
8 changes: 4 additions & 4 deletions src/lib/ActiveClientManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ const clientID = Guid();
*
* @returns {Promise}
*/
const init = () => Ion.merge(IONKEYS.ACTIVE_CLIENT_IDS, {clientID});
const init = () => Ion.merge(IONKEYS.ACTIVE_CLIENTS, {clientID});

/**
* Remove this client ID from the array of active client IDs when this client is exited
*
* @returns {Promise}
*/
function removeClient() {
return Ion.get(IONKEYS.ACTIVE_CLIENT_IDS)
return Ion.get(IONKEYS.ACTIVE_CLIENTS)
.then(activeClientIDs => _.omit(activeClientIDs, clientID))
.then(newActiveClientIDs => Ion.set(IONKEYS.ACTIVE_CLIENT_IDS, newActiveClientIDs));
.then(newActiveClientIDs => Ion.set(IONKEYS.ACTIVE_CLIENTS, newActiveClientIDs));
}

/**
Expand All @@ -29,7 +29,7 @@ function removeClient() {
* @returns {Promise}
*/
function isClientTheLeader() {
return Ion.get(IONKEYS.ACTIVE_CLIENT_IDS)
return Ion.get(IONKEYS.ACTIVE_CLIENTS)
.then(activeClientIDs => _.first(activeClientIDs) === clientID);
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/Network.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ let isOffline;
Ion.connect({key: IONKEYS.NETWORK, path: 'isOffline', callback: val => isOffline = val});

let credentials;
Ion.connect({key: IONKEYS.CREDENTIALS, callback: c => credentials = c});
Ion.connect({key: IONKEYS.CREDENTIALS, callback: val => credentials = val});

let currentUrl;
Ion.connect({key: IONKEYS.CURRENT_URL, callback: url => currentUrl = url});
Ion.connect({key: IONKEYS.CURRENT_URL, callback: val => currentUrl = val});

/**
* When authTokens expire they will automatically be refreshed.
Expand Down
Loading